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-05-19 20:56:37 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-19 20:56:37 -0700
commite2ab1b30b1a669425cb86ffa7def9529e7fa4fb1 (patch)
tree5d1a03f7afbdf6bc115a63b68e7bd64dd0286d2d /shell/tokenize.mu
parent6bbeadecaad7b6437626b10f7e230ba305c8496f (diff)
downloadmu-e2ab1b30b1a669425cb86ffa7def9529e7fa4fb1.tar.gz
disallow null traces
We now use traces everywhere for error-checking. Null traces introduce
the possibility of changing a functions error response, and therefore its
semantics.
Diffstat (limited to 'shell/tokenize.mu')
-rw-r--r--shell/tokenize.mu35
1 files changed, 28 insertions, 7 deletions
diff --git a/shell/tokenize.mu b/shell/tokenize.mu
index ed05b2de..03c04910 100644
--- a/shell/tokenize.mu
+++ b/shell/tokenize.mu
@@ -42,7 +42,10 @@ fn test-tokenize-quote {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -66,7 +69,10 @@ fn test-tokenize-backquote {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -90,7 +96,10 @@ fn test-tokenize-unquote {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -114,7 +123,10 @@ fn test-tokenize-unquote-splice {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -131,7 +143,10 @@ fn test-tokenize-dotted-list {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -156,7 +171,10 @@ fn test-tokenize-stream-literal {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage
@@ -179,7 +197,10 @@ fn test-tokenize-stream-literal-in-tree {
   var stream-storage: (stream cell 0x10)
   var stream/edi: (addr stream cell) <- address stream-storage
   #
-  tokenize in, stream, 0/no-trace
+  var trace-storage: trace
+  var trace/edx: (addr trace) <- address trace-storage
+  initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible
+  tokenize in, stream, trace
   #
   var curr-token-storage: cell
   var curr-token/ebx: (addr cell) <- address curr-token-storage