about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-07-11 21:58:52 -0700
committerKartik Agaram <vc@akkartik.com>2020-07-11 22:02:31 -0700
commit8bf95d294a7e74efd16311d926c6a2a8c1979052 (patch)
tree03d4d6c9d20b886b2703564c0c359011391a380c
parent5c86f9be66cc0411eeb1eef473958657ae214291 (diff)
downloadmu-8bf95d294a7e74efd16311d926c6a2a8c1979052.tar.gz
6637
Be more consistent about what we interpret as integer literals.
-rwxr-xr-xapps/mubin345596 -> 345626 bytes
-rw-r--r--apps/mu.subx9
2 files changed, 9 insertions, 0 deletions
diff --git a/apps/mu b/apps/mu
index b9a48e39..5507e0c5 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/mu.subx b/apps/mu.subx
index b9aeeccf..40628ece 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -7031,6 +7031,15 @@ parse-type:  # ad: (addr allocation-descriptor), in: (addr stream byte), out: (a
       # if s is a number, store it in the type's size field
       {
 $parse-type:check-for-int:
+        # var tmp/eax: byte = *s->slice
+        8b/-> *ecx 0/r32/eax
+        8a/copy-byte *eax 0/r32/AL
+        81 4/subop/and %eax 0xff/imm32
+        # TODO: raise an error on `var x: (array int a)`
+        (is-decimal-digit? %eax)  # => eax
+        3d/compare-eax-and 0/imm32/false
+        74/jump-if-= break/disp8
+        #
         (is-hex-int? %ecx)  # => eax
         3d/compare-eax-and 0/imm32/false
         74/jump-if-= break/disp8