diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-15 19:12:07 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-15 19:12:07 -0700 |
commit | d41917290ae8e19bdfa76df15e6ee2f74cf7d970 (patch) | |
tree | 119cee067c77320bce34fea77e0715c907c5887e | |
parent | 849f80ac2245ae8d3f00ad4ab5e57fc79a2effe4 (diff) | |
download | mu-d41917290ae8e19bdfa76df15e6ee2f74cf7d970.tar.gz |
.
-rw-r--r-- | shell/parse.mu | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/shell/parse.mu b/shell/parse.mu index dde7da4d..6788c018 100644 --- a/shell/parse.mu +++ b/shell/parse.mu @@ -74,15 +74,18 @@ fn parse-sexpression tokens: (addr stream cell), _out: (addr handle cell), trace break-if-!= var curr-addr/eax: (addr cell) <- lookup *curr curr <- get curr-addr, right + var tmp-storage: (handle cell) + var tmp/edx: (addr handle cell) <- address tmp-storage $parse-sexpression:list-loop: { - allocate-pair curr - var curr-addr/eax: (addr cell) <- lookup *curr - var left/ecx: (addr handle cell) <- get curr-addr, left { - var close-paren?/eax: boolean <- parse-sexpression tokens, left, trace + var close-paren?/eax: boolean <- parse-sexpression tokens, tmp, trace + allocate-pair curr compare close-paren?, 0/false break-if-!= $parse-sexpression:list-loop } + var curr-addr/eax: (addr cell) <- lookup *curr + var left/ecx: (addr handle cell) <- get curr-addr, left + copy-object tmp, left # curr <- get curr-addr, right loop |