about summary refs log tree commit diff stats
path: root/061channel.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-17 18:51:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-17 18:51:14 -0700
commitb75300444bd320a45d1366b093177c538d35c0a6 (patch)
tree862a44688e412ebcd74281f0fa867e387e09015d /061channel.mu
parente52972cb0aaa749e901b518c0b594dd14d687fa6 (diff)
downloadmu-b75300444bd320a45d1366b093177c538d35c0a6.tar.gz
1808 - helper to print newlines during debugging
The recent session makes me weary of deleting comment counts from inside
strings, and the newlines everywhere take up vertical space. Considered
println like pascal/ruby, but I'd like something I can add/remove at the
end of existing prints. So this hack for $print.
Diffstat (limited to '061channel.mu')
-rw-r--r--061channel.mu14
1 files changed, 5 insertions, 9 deletions
diff --git a/061channel.mu b/061channel.mu
index 9f86ba2d..2a839898 100644
--- a/061channel.mu
+++ b/061channel.mu
@@ -298,25 +298,22 @@ recipe buffer-lines [
         break-unless backspace?:boolean
         # drop previous character
 #?         close-console #? 2
-#?         $print [backspace! #? 1
+#?         $print [backspace!
 #? ] #? 1
         {
           buffer-length:address:number <- get-address line:address:buffer/deref, length:offset
           buffer-empty?:boolean <- equal buffer-length:address:number/deref, 0:literal
           break-if buffer-empty?:boolean
-#?           $print [before: ], buffer-length:address:number/deref, [ 
-#? ] #? 1
+#?           $print [before: ], buffer-length:address:number/deref, 10:literal/newline
           buffer-length:address:number/deref <- subtract buffer-length:address:number/deref, 1:literal
-#?           $print [after: ], buffer-length:address:number/deref, [ 
-#? ] #? 1
+#?           $print [after: ], buffer-length:address:number/deref, 10:literal/newline
         }
 #?         $exit #? 2
         # and don't append this one
         loop +next-character:label
       }
       # append anything else
-#?       $print [buffer-lines: appending ], c:character, [ 
-#? ]
+#?       $print [buffer-lines: appending ], c:character, 10:literal/newline
       line:address:buffer <- buffer-append line:address:buffer, c:character
       line-done?:boolean <- equal c:character, 10:literal/newline
       break-if line-done?:boolean
@@ -337,8 +334,7 @@ recipe buffer-lines [
       break-if done?:boolean
       c:character <- index line-contents:address:array:character/deref, i:number
       out:address:channel <- write out:address:channel, c:character
-#?       $print [writing ], i:number, [: ], c:character, [ 
-#? ] #? 1
+#?       $print [writing ], i:number, [: ], c:character, 10:literal/newline
       i:number <- add i:number, 1:literal
       loop
     }