diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-01-28 00:04:00 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-01-28 00:04:00 -0800 |
commit | dc9eb7f712c6088548297521e608445f5d09dc81 (patch) | |
tree | 6f746e1adbef126726f9c5cceca7c5738c2b61ab /color-repl.mu | |
parent | 6533cdd047c09591aa9f93f8861f88cf3c869239 (diff) | |
download | mu-dc9eb7f712c6088548297521e608445f5d09dc81.tar.gz |
649 - support #\( and #\) in repl
Diffstat (limited to 'color-repl.mu')
-rw-r--r-- | color-repl.mu | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/color-repl.mu b/color-repl.mu index fcbc75de..ef13c5ce 100644 --- a/color-repl.mu +++ b/color-repl.mu @@ -30,6 +30,15 @@ (jump next-key:offset) } (result:buffer-address <- append result:buffer-address c:character) + ; record backslash and one additional character + ; test: (prn #\() + { begin + (backslash?:boolean <- equal c:character ((#\\ literal))) + (break-unless backslash?:boolean) + ($print-key-to-host c:character 7:literal/white) + (result:buffer-address <- slurp-escaped-character result:buffer-address 7:literal/white) + (jump next-key:offset) + } ; parse comment { begin (comment?:boolean <- equal c:character ((#\; literal))) @@ -150,7 +159,7 @@ { begin (backslash?:boolean <- equal c:character ((#\\ literal))) (break-unless backslash?:boolean) - (result:buffer-address <- slurp-escaped-character result:buffer-address) + (result:buffer-address <- slurp-escaped-character result:buffer-address 6:literal/cyan) (jump next-key-in-string:offset) } ; if not backslash @@ -163,8 +172,9 @@ (function slurp-escaped-character [ (default-space:space-address <- new space:literal 30:literal) (result:buffer-address <- next-input) + (color-code:integer <- next-input) (c2:character <- $wait-for-key-from-host) - ($print-key-to-host c2:character 6:literal/fg/cyan) + ($print-key-to-host c2:character color-code:integer) ; handle backspace ; test: "abc\<backspace>def" { begin |