about summary refs log tree commit diff stats
path: root/shell/tokenize.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-27 23:10:30 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-27 23:10:30 -0700
commit55cde01edfe504855f171b6dbdc312cbcc02872b (patch)
treee39ebe42c53e6a8e906319faf6d318f4f6f6837d /shell/tokenize.mu
parent9e9e40c05a1a6df71f57f98044da4258ac013b5c (diff)
downloadmu-55cde01edfe504855f171b6dbdc312cbcc02872b.tar.gz
shell: stream literals
Diffstat (limited to 'shell/tokenize.mu')
-rw-r--r--shell/tokenize.mu7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/tokenize.mu b/shell/tokenize.mu
index 1293e91f..46ca0a6b 100644
--- a/shell/tokenize.mu
+++ b/shell/tokenize.mu
@@ -624,6 +624,13 @@ fn number-token? _in: (addr cell) -> _/eax: boolean {
 
 fn bracket-token? _in: (addr cell) -> _/eax: boolean {
   var in/eax: (addr cell) <- copy _in
+  {
+    var in-type/eax: (addr int) <- get in, type
+    compare *in-type, 3/stream
+    break-if-!=
+    # streams are never paren tokens
+    return 0/false
+  }
   var in-data-ah/eax: (addr handle stream byte) <- get in, text-data
   var in-data/eax: (addr stream byte) <- lookup *in-data-ah
   rewind-stream in-data