about summary refs log tree commit diff stats
path: root/apps/calls.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-09-06 16:17:51 -0700
committerKartik Agaram <vc@akkartik.com>2019-09-06 16:17:51 -0700
commite836615a605f4c86b0d56b1a90779d8b7457bdba (patch)
tree471b28014e3655b0c437dadd4c34174793d62b9d /apps/calls.subx
parent8475b51e40c2e54bdcb8c5002262f2554ab26e8b (diff)
downloadmu-e836615a605f4c86b0d56b1a90779d8b7457bdba.tar.gz
5630
Diffstat (limited to 'apps/calls.subx')
-rw-r--r--apps/calls.subx62
1 files changed, 57 insertions, 5 deletions
diff --git a/apps/calls.subx b/apps/calls.subx
index 6768fe7f..1c8fcdeb 100644
--- a/apps/calls.subx
+++ b/apps/calls.subx
@@ -389,9 +389,6 @@ $next-word-string-or-expression-without-metadata:check-for-end-of-call:
     # . if (eax == '/') goto error3
     3d/compare-eax-and 0x2f/imm32/slash
     0f 84/jump-if-equal $next-word-string-or-expression-without-metadata:error3/disp32
-    # if (line->data[line->read] != ' ') goto error4
-    3d/compare-eax-and 0x20/imm32/space
-    0f 85/jump-if-not-equal $next-word-string-or-expression-without-metadata:error4/disp32
     # skip-chars-matching-whitespace(line)
     # . . push args
     56/push-esi
@@ -1120,7 +1117,7 @@ test-next-word-string-or-expression-without-metadata-handles-comment-after-trail
     81 0/subop/add %esp 8/imm32
     # check-ints-equal(slice->start, 0, msg)
     # . . push args
-    68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: start"/imm32
+    68/push "F - test-next-word-string-or-expression-without-metadata-handles-comment-after-trailing-close-paren: start"/imm32
     68/push 0/imm32
     ff 6/subop/push *ecx
     # . . call
@@ -1129,7 +1126,62 @@ test-next-word-string-or-expression-without-metadata-handles-comment-after-trail
     81 0/subop/add %esp 0xc/imm32
     # check-ints-equal(slice->end, 0, msg)
     # . . push args
-    68/push "F - test-next-word-string-or-expression-without-metadata-returns-eol-on-trailing-close-paren: end"/imm32
+    68/push "F - test-next-word-string-or-expression-without-metadata-handles-comment-after-trailing-close-paren: end"/imm32
+    68/push 0/imm32
+    ff 6/subop/push *(ecx+4)
+    # . . call
+    e8/call check-ints-equal/disp32
+    # . . discard args
+    81 0/subop/add %esp 0xc/imm32
+    # . epilog
+    89/<- %esp 5/r32/ebp
+    5d/pop-to-ebp
+    c3/return
+
+test-next-word-string-or-expression-without-metadata-handles-newline-after-trailing-close-paren:
+    # . prolog
+    55/push-ebp
+    89/<- %ebp 4/r32/esp
+    # setup
+    # . clear-stream(_test-input-stream)
+    # . . push args
+    68/push _test-input-stream/imm32
+    # . . call
+    e8/call clear-stream/disp32
+    # . . discard args
+    81 0/subop/add %esp 4/imm32
+    # var slice/ecx = {0, 0}
+    68/push 0/imm32/end
+    68/push 0/imm32/start
+    89/<- %ecx 4/r32/esp
+    # write(_test-input-stream, " )\n")
+    # . . push args
+    68/push " )\n"/imm32
+    68/push _test-input-stream/imm32
+    # . . call
+    e8/call write/disp32
+    # . . discard args
+    81 0/subop/add %esp 8/imm32
+    # next-word-string-or-expression-without-metadata(_test-input-stream, slice)
+    # . . push args
+    51/push-ecx
+    68/push _test-input-stream/imm32
+    # . . call
+    e8/call next-word-string-or-expression-without-metadata/disp32
+    # . . discard args
+    81 0/subop/add %esp 8/imm32
+    # check-ints-equal(slice->start, 0, msg)
+    # . . push args
+    68/push "F - test-next-word-string-or-expression-without-metadata-handles-newline-after-trailing-close-paren: start"/imm32
+    68/push 0/imm32
+    ff 6/subop/push *ecx
+    # . . call
+    e8/call check-ints-equal/disp32
+    # . . discard args
+    81 0/subop/add %esp 0xc/imm32
+    # check-ints-equal(slice->end, 0, msg)
+    # . . push args
+    68/push "F - test-next-word-string-or-expression-without-metadata-handles-newline-after-trailing-close-paren: end"/imm32
     68/push 0/imm32
     ff 6/subop/push *(ecx+4)
     # . . call