diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-15 08:45:51 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-15 08:47:58 -0700 |
commit | 126a0390f5a08a642f8f1066c1709aaed1ad047b (patch) | |
tree | 67f873114257c8273376b1d412001ac51dead52f /shell | |
parent | 262290a4e8bd6d8f975f84a03bb10809623bd61a (diff) | |
download | mu-126a0390f5a08a642f8f1066c1709aaed1ad047b.tar.gz |
.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/tokenize.mu | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/shell/tokenize.mu b/shell/tokenize.mu index d40ca2bb..d591646c 100644 --- a/shell/tokenize.mu +++ b/shell/tokenize.mu @@ -557,13 +557,15 @@ fn quote-token? _in: (addr cell) -> _/eax: boolean { fn open-paren-token? _in: (addr cell) -> _/eax: boolean { var in/eax: (addr cell) <- copy _in var in-data-ah/eax: (addr handle stream byte) <- get in, text-data - var in-data/eax: (addr stream byte) <- lookup *in-data-ah + var _in-data/eax: (addr stream byte) <- lookup *in-data-ah + var in-data/ecx: (addr stream byte) <- copy _in-data rewind-stream in-data var g/eax: grapheme <- read-grapheme in-data compare g, 0x28/open-paren { break-if-!= - return 1/true + var result/eax: boolean <- stream-empty? in-data + return result } return 0/false } @@ -571,13 +573,15 @@ fn open-paren-token? _in: (addr cell) -> _/eax: boolean { fn close-paren-token? _in: (addr cell) -> _/eax: boolean { var in/eax: (addr cell) <- copy _in var in-data-ah/eax: (addr handle stream byte) <- get in, text-data - var in-data/eax: (addr stream byte) <- lookup *in-data-ah + var _in-data/eax: (addr stream byte) <- lookup *in-data-ah + var in-data/ecx: (addr stream byte) <- copy _in-data rewind-stream in-data var g/eax: grapheme <- read-grapheme in-data - compare g, 0x29/open-paren + compare g, 0x29/close-paren { break-if-!= - return 1/true + var result/eax: boolean <- stream-empty? in-data + return result } return 0/false } |