diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-04-23 17:24:17 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-05-18 00:44:47 -0700 |
commit | 12c5a840d80e5f9385a49eec35d412384f6b45f8 (patch) | |
tree | 80dc84867ff108b722d2c2b9c1113f69743ffe01 | |
parent | f3d95174ae8827c5e340db37359b0fe937ebf1e9 (diff) | |
download | mu-12c5a840d80e5f9385a49eec35d412384f6b45f8.tar.gz |
mu.subx: parse-mu
-rw-r--r-- | apps/mu.subx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/mu.subx b/apps/mu.subx index 579ffa82..73f13ed4 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -3255,10 +3255,21 @@ $parse-mu:type: (next-mu-token %ecx %edx) # var type-id/eax: int (pos-or-insert-slice Type-id %edx) # => eax - # var new-type/eax: (handle typeinfo) - (find-or-create-typeinfo %eax) # => eax + # spill + 51/push-ecx + # var new-type/ecx: (handle typeinfo) + 68/push 0/imm32 + 68/push 0/imm32 + 89/<- %ecx 4/r32/esp + (find-or-create-typeinfo %eax %ecx) + # + (lookup *ecx *(ecx+4)) # => eax # TODO: ensure that 'line' has nothing else but '{' (populate-mu-type *(ebp+8) %eax) # => eax + # reclaim new-type + 81 0/subop/add %esp 8/imm32 + # restore + 59/pop-to-ecx e9/jump $parse-mu:line-loop/disp32 } # otherwise abort @@ -6172,7 +6183,7 @@ $find-or-create-typeinfo-fields:end: 5d/pop-to-ebp c3/return -populate-mu-type: # in: (addr stream byte), t: (handle typeinfo) +populate-mu-type: # in: (addr stream byte), t: (addr typeinfo) # pseudocode: # var line: (stream byte 512) # curr-index = 0 |