about summary refs log tree commit diff stats
path: root/apps/mu.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-03 16:12:14 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-18 00:44:47 -0700
commitbcf02529b8b0438f36aab4a7893e8be1d602a5e1 (patch)
tree4d8e4386fbed9352dabc651a86a3e574f06b737c /apps/mu.subx
parent3bc5d1d7250b7b07520f215ec55805bcf262adab (diff)
downloadmu-bcf02529b8b0438f36aab4a7893e8be1d602a5e1.tar.gz
mu.subx: more progress on parse-mu-block
Diffstat (limited to 'apps/mu.subx')
-rw-r--r--apps/mu.subx16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index 38c5fcd0..4cf22917 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -4765,7 +4765,6 @@ $parse-mu-block:line-loop:
       # if (line->write == 0) break
       81 7/subop/compare *ecx 0/imm32
       0f 84/jump-if-= break/disp32
-      # HERE
       # word-slice = next-mu-token(line)
       (next-mu-token %ecx %edx)
 #?       (write-buffered Stderr "word: ")
@@ -4792,8 +4791,16 @@ $parse-mu-block:check-for-block:
         74/jump-if-= break/disp8
         (check-no-tokens-left %ecx)
         # parse new block and append
-        (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10))  # => eax
-        (append-to-block Heap %edi %eax)
+        # . var tmp/eax: (handle block)
+        68/push 0/imm32
+        68/push 0/imm32
+        89/<- %eax 4/r32/esp
+        # .
+        (parse-mu-block *(ebp+8) *(ebp+0xc) *(ebp+0x10) %eax)
+        (append-to-block Heap %edi  *eax *(eax+4))
+        # . reclaim tmp
+        81 0/subop/add %esp 8/imm32
+        # .
         e9/jump $parse-mu-block:line-loop/disp32
       }
       # if slice-equal?(word-slice, "}") break
@@ -4817,6 +4824,7 @@ $parse-mu-block:check-for-named-block:
         # skip ':'
         ff 1/subop/decrement *(edx+4)  # Slice-end
         #
+        # HERE
         (parse-mu-named-block %edx *(ebp+8) *(ebp+0xc) *(ebp+0x10))  # => eax
         (append-to-block Heap %edi %eax)
         e9/jump $parse-mu-block:line-loop/disp32
@@ -5977,7 +5985,7 @@ append-to-block:  # ad: (addr allocation-descriptor), block: (addr block), x: (h
     # esi = block
     8b/-> *(ebp+0xc) 6/r32/esi
     # block->stmts = append(x, block->stmts)
-    8d/copy-address *(esi+4) 0/r32/eax
+    8d/copy-address *(esi+4) 0/r32/eax  # Block-stmts
     (append-list *(ebp+8)  *(ebp+0x10) *(ebp+0x14)  *(esi+4) *(esi+8)  %eax)  # ad, x, x, Block-stmts, Block-stmts
 $append-to-block:end:
     # . restore registers