diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-30 20:43:34 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-30 20:43:34 -0700 |
commit | c8fb6d6aca925b3043cc53b2b22e6b8cd462f056 (patch) | |
tree | fe27e547d16d6a22707ab9d0141887a0bc8b84e7 | |
parent | 49d60aa575bff129d3498d70b727dbe273ef3908 (diff) | |
download | mu-c8fb6d6aca925b3043cc53b2b22e6b8cd462f056.tar.gz |
clean up final abort in macroexpand
-rw-r--r-- | shell/print.mu | 9 | ||||
-rw-r--r-- | shell/sandbox.mu | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/shell/print.mu b/shell/print.mu index 1f652fa5..6db5a25d 100644 --- a/shell/print.mu +++ b/shell/print.mu @@ -298,7 +298,14 @@ fn print-pair _in: (addr cell), out: (addr stream byte), trace: (addr trace) { { compare right-addr, 0 break-if-!= - abort "NULL in print!" + { + var overflow?/eax: boolean <- try-write out, " ... NULL" + compare overflow?, 0/false + break-if-= + error trace, "print-pair: no space for ' ... NULL'" + return + } + return } { var right-nil?/eax: boolean <- nil? right-addr diff --git a/shell/sandbox.mu b/shell/sandbox.mu index 6a6180fa..eb18990c 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -613,6 +613,12 @@ fn run-sandbox _self: (addr sandbox), globals: (addr global-table) { rewind-keyboard-var inner-keyboard-var # don't clear keys from before # read-and-evaluate-and-save-gap-buffer-to-globals data-ah, eval-result-ah, globals, definitions-created, trace, inner-screen-var, inner-keyboard-var + var error?/eax: boolean <- has-errors? trace + { + compare error?, 0/false + break-if-= + return + } # if necessary, initialize a new gap-buffer for sandbox { compare globals, 0 |