From 91b7b0be73b88c38e11e21501e813a6b7a048f45 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 18 May 2021 19:51:58 -0700 Subject: shell: clean up trace for macroexpand --- shell/evaluate.mu | 4 ++++ shell/macroexpand.mu | 3 +++ 2 files changed, 7 insertions(+) (limited to 'shell') diff --git a/shell/evaluate.mu b/shell/evaluate.mu index 5b58fc08..d4fee50e 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -1561,6 +1561,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e break-if-= return } + trace-lower trace var in-ah/esi: (addr handle cell) <- copy _in-ah var in/eax: (addr cell) <- lookup *in-ah { @@ -1603,6 +1604,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e debug-print ",", 3/fg, 0/bg evaluate rest-ah, _out-ah, env-h, globals, trace, screen-cell, keyboard-cell, call-number debug-print ",)", 3/fg, 0/bg + trace-higher trace return } # check for unquote-splice in in-left @@ -1661,6 +1663,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e # append result of in-right var in-right-ah/ecx: (addr handle cell) <- get in, right evaluate-backquote in-right-ah, out-ah, env-h, globals, trace, screen-cell, keyboard-cell, call-number + trace-higher trace return } debug-print "19", 4/fg, 0/bg @@ -1690,6 +1693,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e debug-print "`r(", 3/fg, 0/bg evaluate-backquote in-right-ah, out-right-ah, env-h, globals, trace, screen-cell, keyboard-cell, call-number debug-print "`r)", 3/fg, 0/bg + trace-higher trace } fn test-evaluate-backquote-list { diff --git a/shell/macroexpand.mu b/shell/macroexpand.mu index e7b0b470..70de1091 100644 --- a/shell/macroexpand.mu +++ b/shell/macroexpand.mu @@ -43,6 +43,7 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), trace trace, "mac", stream } # }}} + trace-lower trace # if expr is a non-pair, return var expr/eax: (addr cell) <- lookup *expr-ah { @@ -193,6 +194,7 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), # TODO: check car(macro-definition) is litfn #? turn-on-debug-print apply macro-definition-ah, rest-ah, expr-ah, globals, trace, 0/no-screen, 0/no-keyboard, 0/call-number + trace-higher trace return 1/true } # no macro found; process any macros within args @@ -213,6 +215,7 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), rest-ah <- get rest, right loop } + trace-higher trace return result } -- cgit 1.4.1-2-gfad0