about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--apps/arith.mu15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/arith.mu b/apps/arith.mu
index 4eef6127..7d6c76b4 100644
--- a/apps/arith.mu
+++ b/apps/arith.mu
@@ -24,14 +24,7 @@ fn simplify -> result/eax: int, look/esi: byte {
     look <- get-char  # prime the pump
     # first arg
     look <- skip-spaces look
-    {
-      {
-        var is-digit?/eax: boolean <- is-decimal-digit? look
-        compare is-digit?, 0  # false
-        break-if-= $simplify:body
-      }
-      result, look <- num look
-    }
+    result, look <- num look
     # operator
     var op/ecx: byte <- copy 0
     look <- skip-spaces look
@@ -106,4 +99,10 @@ fn skip-spaces _look: byte -> look/esi: byte {
 fn get-char -> look/esi: byte {
   var tmp/eax: byte <- read-key
   look <- copy tmp
+  compare look, 0
+  {
+    break-if-!=
+    print-string "^D\n"
+    syscall_exit
+  }
 }