about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-27 17:13:43 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-27 17:13:43 -0800
commit5e369be2ed76fe9c1ac70f356a58833290476c1c (patch)
tree1add6fe10fb67078011511b4b9eb370ca3f12641
parent0943c85d6b6f8291b881aa9aee818bf7de66f79e (diff)
downloadmu-5e369be2ed76fe9c1ac70f356a58833290476c1c.tar.gz
640 - some todos for tests
-rw-r--r--color-repl.mu10
1 files changed, 10 insertions, 0 deletions
diff --git a/color-repl.mu b/color-repl.mu
index 2b3712fd..e5cecae5 100644
--- a/color-repl.mu
+++ b/color-repl.mu
@@ -4,9 +4,11 @@
   (default-space:space-address <- new space:literal 30:literal)
   (result:buffer-address <- init-buffer 30:literal)
   (open-parens:integer <- copy 0:literal)
+  ; test: 34<enter>
   { begin
     (c:character <- $wait-for-key-from-host)
     ; handle backspace
+    ; test: 3<backspace>4<enter>
     ; todo: backspace into comment or string; backspace past newline
     { begin
       (backspace?:boolean <- equal c:character ((#\backspace literal)))
@@ -42,6 +44,8 @@
       (loop 2:blocks)
     }
     ; balance parens
+    ; test: (+ 1 1)<enter>
+    ; test: (def foo () (+ 1 (* 2 3)))<enter>
     { begin
       (open-paren?:boolean <- equal c:character ((#\( literal)))
       (break-unless open-paren?:boolean)
@@ -80,10 +84,12 @@
 
 (function skip-comment [
   (default-space:space-address <- new space:literal 30:literal)
+  ; test: ; abc<enter>
   { begin
     (c:character <- $wait-for-key-from-host)
     ($print-key-to-host c:character 4:literal/fg/blue)
     ; handle backspace
+    ; test: ; abc<backspace><backspace>def<enter>
     ; todo: how to exit comment?
     { begin
       (backspace?:boolean <- equal c:character ((#\backspace literal)))
@@ -106,16 +112,20 @@
 (function slurp-string [
   (default-space:space-address <- new space:literal 30:literal)
   (result:buffer-address <- next-input)
+  ; test: "abc"
   { begin
     (c:character <- $wait-for-key-from-host)
     ($print-key-to-host c:character 6:literal/fg/cyan)
     ; handle backspace
+    ; test: "abc<backspace>d"
     ; todo: how to exit string?
     { begin
       (backspace?:boolean <- equal c:character ((#\backspace literal)))
       (break-unless backspace?:boolean)
       (len:integer-address <- get-address result:buffer-address/deref length:offset)
       ; but only if we need to
+      ; test: "<backspace>abc"
+      ; unnecessary?!
       { begin
         (zero?:boolean <- lesser-or-equal len:integer-address/deref 0:literal)
         (break-if zero?:boolean)