diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-02-26 22:14:36 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-02-26 22:14:36 -0800 |
commit | c782d38f0b4d263d243415495b8e9d9c84f119db (patch) | |
tree | 14cd085f42151fdb3e212ae58859e29be0cfa8ae /baremetal | |
parent | c4f43035b0794ff2d430fa02437fcbba19c5004f (diff) | |
download | mu-c782d38f0b4d263d243415495b8e9d9c84f119db.tar.gz |
7816
Diffstat (limited to 'baremetal')
-rw-r--r-- | baremetal/shell/parse.mu | 17 | ||||
-rw-r--r-- | baremetal/shell/read.mu | 6 |
2 files changed, 12 insertions, 11 deletions
diff --git a/baremetal/shell/parse.mu b/baremetal/shell/parse.mu index b9eeccab..918fb108 100644 --- a/baremetal/shell/parse.mu +++ b/baremetal/shell/parse.mu @@ -1,14 +1,9 @@ fn parse-sexpression tokens: (addr stream cell), _out: (addr handle cell), trace: (addr trace) { # For now we just convert first token into a symbol and return it. TODO - var empty?/eax: boolean <- stream-empty? tokens - compare empty?, 0/false - { - break-if-!= - var out/eax: (addr handle cell) <- copy _out - allocate out - var out-addr/eax: (addr cell) <- lookup *out - read-from-stream tokens, out-addr - var type/ecx: (addr int) <- get out-addr, type - copy-to *type, 2/symbol - } + var out/eax: (addr handle cell) <- copy _out + allocate out + var out-addr/eax: (addr cell) <- lookup *out + read-from-stream tokens, out-addr + var type/ecx: (addr int) <- get out-addr, type + copy-to *type, 2/symbol } diff --git a/baremetal/shell/read.mu b/baremetal/shell/read.mu index d5a1d776..e49fbbac 100644 --- a/baremetal/shell/read.mu +++ b/baremetal/shell/read.mu @@ -3,6 +3,12 @@ fn read-cell in: (addr gap-buffer), out: (addr handle cell), trace: (addr trace) var tokens-storage: (stream cell 0x100) var tokens/ecx: (addr stream cell) <- address tokens-storage tokenize in, tokens, trace + var error?/eax: boolean <- has-errors? trace + compare error?, 0/false + { + break-if-= + return + } # TODO: insert parens # TODO: transform infix parse-sexpression tokens, out, trace |