about summary refs log tree commit diff stats
path: root/mu-init.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-22 21:20:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-22 21:23:40 -0700
commit26e9387df6a2653dd2c71d646731a427456a0f7d (patch)
tree98d07ec0b459b9a3bed683cd521a1813ff2ab909 /mu-init.subx
parent74d6a4d38257599a410c2404f3c31420691c125c (diff)
downloadmu-26e9387df6a2653dd2c71d646731a427456a0f7d.tar.gz
snapshot: infix
Like parenthesize, I'm copying tests over from https://github.com/akkartik/wart
Unlike parenthesize, though, I can't just transliterate the code itself.
Wart was operating on an intermediate AST representation. Here I'm all
the way down to cells. That seemed like a good idea when I embarked, but
now I'm not so sure. Operating with the right AST data structure allowed
me to more easily iterate over the elements of a list. The natural recursion
for cells is not a good fit.

This patch and the next couple is an interesting case study in what makes
Unix so effective. Yes, you have to play computer, and yes it gets verbose
and ugly. But just diff and patch go surprisingly far in helping build a
picture of the state space in my brain.

Then again, there's a steep gradient of skills here. There are people who
can visualize state spaces using diff and patch far better than me, and
people who can't do it as well as me. Nature, nurture, having different
priorities, whatever the reason. Giving some people just the right crutch
excludes others.
Diffstat (limited to 'mu-init.subx')
-rw-r--r--mu-init.subx32
1 files changed, 15 insertions, 17 deletions
diff --git a/mu-init.subx b/mu-init.subx
index 438e29e7..26accb8a 100644
--- a/mu-init.subx
+++ b/mu-init.subx
@@ -14,23 +14,21 @@ Entry:
   bd/copy-to-ebp 0/imm32
   #
 #?   (main 0 0 Primary-bus-secondary-drive)
-#?   (set-cursor-position 0 0x40 0x20)
-#?   (test-parenthesize)
-#?   (test-parenthesize-skips-lines-with-initial-parens)
-#?   (test-parenthesize-skips-single-word-lines)
-  # always first run tests
-  (run-tests)
-  (num-test-failures)  # => eax
-  # call main if tests all passed
-  {
-    3d/compare-eax-and 0/imm32
-    75/jump-if-!= break/disp8
-    c7 0/subop/copy *Running-tests? 0/imm32/false
-    (clear-real-screen)
-    c7 0/subop/copy *Real-screen-cursor-x 0/imm32
-    c7 0/subop/copy *Real-screen-cursor-y 0/imm32
-    (main 0 0 Primary-bus-secondary-drive)
-  }
+  (set-cursor-position 0 0x30 2)
+  (test-infix)
+#?   # always first run tests
+#?   (run-tests)
+#?   (num-test-failures)  # => eax
+#?   # call main if tests all passed
+#?   {
+#?     3d/compare-eax-and 0/imm32
+#?     75/jump-if-!= break/disp8
+#?     c7 0/subop/copy *Running-tests? 0/imm32/false
+#?     (clear-real-screen)
+#?     c7 0/subop/copy *Real-screen-cursor-x 0/imm32
+#?     c7 0/subop/copy *Real-screen-cursor-y 0/imm32
+#?     (main 0 0 Primary-bus-secondary-drive)
+#?   }
 
   # hang indefinitely
   {