diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-05-29 15:49:58 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-05-29 15:49:58 -0700 |
commit | 56c621b6f1202f9defbf69dadec6d0cc6dae056d (patch) | |
tree | c918d1e3e8d7b1f53aee3fcc05a0cc26226f993a /shell | |
parent | 8dc3c85a0336acfcb8c0fb67ea10307769f3dad2 (diff) | |
download | mu-56c621b6f1202f9defbf69dadec6d0cc6dae056d.tar.gz |
shell: start reducing the waste in tokenize
Diffstat (limited to 'shell')
-rw-r--r-- | shell/tokenize.mu | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/shell/tokenize.mu b/shell/tokenize.mu index b280a049..e74e549d 100644 --- a/shell/tokenize.mu +++ b/shell/tokenize.mu @@ -246,6 +246,17 @@ fn next-token in: (addr gap-buffer), _out-cell: (addr cell), trace: (addr trace) write-int32-hex stream, gval trace trace, "tokenize", stream } + # open square brackets begin streams + { + compare g, 0x5b/open-square-bracket + break-if-!= + g <- read-from-gap-buffer in # skip open bracket + next-stream-token in, out, trace + var out-cell/eax: (addr cell) <- copy _out-cell + var out-cell-type/eax: (addr int) <- get out-cell, type + copy-to *out-cell-type, 3/stream + break $next-token:body + } # comment { compare g, 0x23/comment @@ -269,17 +280,6 @@ fn next-token in: (addr gap-buffer), _out-cell: (addr cell), trace: (addr trace) next-symbol-token in, out, trace break $next-token:body } - # open square brackets begin streams - { - compare g, 0x5b/open-square-bracket - break-if-!= - g <- read-from-gap-buffer in # skip open bracket - next-stream-token in, out, trace - var out-cell/eax: (addr cell) <- copy _out-cell - var out-cell-type/eax: (addr int) <- get out-cell, type - copy-to *out-cell-type, 3/stream - break $next-token:body - } # unbalanced close square brackets are errors { compare g, 0x5d/close-square-bracket |