From 64d3e8e2e0599c11dd4b38836e7f346c5bb7c5db Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 19 May 2021 23:32:16 -0700 Subject: . --- shell/evaluate.mu | 3 --- shell/macroexpand.mu | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/evaluate.mu b/shell/evaluate.mu index 714e4255..2b8cded0 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -17,9 +17,6 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han } # errors? skip { - var should-trace?/eax: boolean <- should-trace? trace - compare should-trace?, 0/false - break-if-= var error?/eax: boolean <- has-errors? trace compare error?, 0/false break-if-= diff --git a/shell/macroexpand.mu b/shell/macroexpand.mu index 83c3c025..2915bc26 100644 --- a/shell/macroexpand.mu +++ b/shell/macroexpand.mu @@ -16,6 +16,9 @@ fn macroexpand expr-ah: (addr handle cell), globals: (addr global-table), trace: # }}} # loop until convergence { + var error?/eax: boolean <- has-errors? trace + compare error?, 0/false + break-if-!= var expanded?/eax: boolean <- macroexpand-iter expr-ah, globals, trace compare expanded?, 0/false loop-if-!= @@ -119,6 +122,13 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), var curr-ah/eax: (addr handle cell) <- get rest, left var macro-found?/eax: boolean <- macroexpand-iter curr-ah, globals, trace result <- or macro-found? + { + var error?/eax: boolean <- has-errors? trace + compare error?, 0/false + break-if-= + trace-higher trace + return result + } loop } trace-higher trace @@ -217,6 +227,9 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), #? dump-trace trace var macro-found?/eax: boolean <- macroexpand-iter curr-ah, globals, trace result <- or macro-found? + var error?/eax: boolean <- has-errors? trace + compare error?, 0/false + break-if-!= var rest/eax: (addr cell) <- lookup *rest-ah { var nil?/eax: boolean <- nil? rest -- cgit 1.4.1-2-gfad0