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 ]