about summary refs log tree commit diff stats
path: root/baremetal/shell/parse.mu
diff options
context:
space:
mode:
Diffstat (limited to 'baremetal/shell/parse.mu')
-rw-r--r--baremetal/shell/parse.mu11
1 files changed, 11 insertions, 0 deletions
diff --git a/baremetal/shell/parse.mu b/baremetal/shell/parse.mu
index f55adf6d..dd87ae0e 100644
--- a/baremetal/shell/parse.mu
+++ b/baremetal/shell/parse.mu
@@ -1,4 +1,6 @@
 fn parse-sexpression tokens: (addr stream cell), _out: (addr handle cell), trace: (addr trace) {
+  trace-text trace, "read", "parse"
+  trace-lower trace
   rewind-stream tokens
   var curr-token-storage: cell
   var curr-token/ecx: (addr cell) <- address curr-token-storage
@@ -10,6 +12,7 @@ fn parse-sexpression tokens: (addr stream cell), _out: (addr handle cell), trace
     var curr-token-data-ah/eax: (addr handle stream byte) <- get curr-token, text-data
     var _curr-token-data/eax: (addr stream byte) <- lookup *curr-token-data-ah
     var curr-token-data/esi: (addr stream byte) <- copy _curr-token-data
+    trace trace, "read", curr-token-data
     # number
     var is-number-token?/eax: boolean <- is-number-token? curr-token
     compare is-number-token?, 0/false
@@ -24,6 +27,14 @@ fn parse-sexpression tokens: (addr stream cell), _out: (addr handle cell), trace
       var out-addr/eax: (addr cell) <- lookup *out
       var dest/edi: (addr float) <- get out-addr, number-data
       copy-to *dest, val-float
+      {
+        var stream-storage: (stream byte 0x40)
+        var stream/ecx: (addr stream byte) <- address stream-storage
+        trace-higher trace
+        write stream, "=> number "
+        print-number out-addr, stream, 0/no-trace
+        trace trace, "read", stream
+      }
       return
     }
     # Temporary default: just convert first token to symbol and return it.