From 8bf95d294a7e74efd16311d926c6a2a8c1979052 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 11 Jul 2020 21:58:52 -0700 Subject: 6637 Be more consistent about what we interpret as integer literals. --- apps/mu.subx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/mu.subx') diff --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 -- cgit 1.4.1-2-gfad0