about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-18 23:10:01 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-18 23:10:01 -0700
commitad46997f9559b12b5ef7b6fd88f881651a1cc0ca (patch)
treebb2669f17bc046b14c355e8d4a92399b5a7283e4
parent2f10bc73023234aa46c71cb36a075cb5fe1bbf1a (diff)
downloadmu-ad46997f9559b12b5ef7b6fd88f881651a1cc0ca.tar.gz
.
-rw-r--r--shell/print.mu7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/print.mu b/shell/print.mu
index c89e301f..7d6b8eb3 100644
--- a/shell/print.mu
+++ b/shell/print.mu
@@ -1,4 +1,5 @@
 fn print-cell _in: (addr handle cell), out: (addr stream byte), trace: (addr trace) {
+  check-stack
   trace-text trace, "print", "print"
   trace-lower trace
   var in/eax: (addr handle cell) <- copy _in
@@ -99,6 +100,8 @@ fn print-symbol _in: (addr cell), out: (addr stream byte), trace: (addr trace) {
   rewind-stream data
   write-stream out, data
   # trace
+  compare trace, 0
+  break-if-=
   rewind-stream data
   var stream-storage: (stream byte 0x40)
   var stream/ecx: (addr stream byte) <- address stream-storage
@@ -118,6 +121,8 @@ fn print-stream _in: (addr cell), out: (addr stream byte), trace: (addr trace) {
   write-stream out, data
   write out, "]"
   # trace
+  compare trace, 0
+  break-if-=
   rewind-stream data
   var stream-storage: (stream byte 0x40)
   var stream/ecx: (addr stream byte) <- address stream-storage
@@ -131,6 +136,8 @@ fn print-number _in: (addr cell), out: (addr stream byte), trace: (addr trace) {
   var val/eax: (addr float) <- get in, number-data
   write-float-decimal-approximate out, *val, 3/precision
   # trace
+  compare trace, 0
+  break-if-=
   var stream-storage: (stream byte 0x40)
   var stream/ecx: (addr stream byte) <- address stream-storage
   write stream, "=> number "