From 953e6511ee2eeb8f5cd60977b2882a6539a93c57 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 20 Oct 2019 15:27:03 -0500 Subject: [PATCH] core: allow char: \# --- core/strings/parser/parser.factor | 1 + extra/modern/modern.factor | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/strings/parser/parser.factor b/core/strings/parser/parser.factor index bce99680c3..c177cbbd1c 100644 --- a/core/strings/parser/parser.factor +++ b/core/strings/parser/parser.factor @@ -32,6 +32,7 @@ ERROR: bad-escape char ; { char: \} char: \} } { char: \) char: \) } { char: \' char: \' } + { char: \# char: \# } } ?at [ bad-escape ] unless ; INITIALIZED-SYMBOL: name>char-hook [ diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index edaaa794d1..0955ad5ca9 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -383,7 +383,7 @@ DEFER: lex-factor-top* : lex-factor-fallthrough ( string n/f slice/f ch/f -- string n'/f literal ) { - { char: # [ read-turnoff ] } ! char: \# + { char: \# [ read-turnoff ] } ! char: \# { char: \\ [ read-backslash ] } { char: \[ [ read-bracket ] } { char: \{ [ read-brace ] } @@ -391,6 +391,7 @@ DEFER: lex-factor-top* { char: \] [ ] } { char: \} [ ] } { char: \) [ ] } + { f [ ] } ! end of stream { char: \" [ read-string ] } { char: \! [ read-exclamation ] } { char: > [ @@ -399,7 +400,6 @@ DEFER: lex-factor-top* [ slice-til-whitespace drop ] dip ?span-slices ] unless ] } - { f [ ] } ! foo{abc}s -- the ``s`` here is fine ! any character that is not special is fine here [ drop ]