core: allow char: \#

modern-harvey3
Doug Coleman 2019-10-20 15:27:03 -05:00
parent aa47ba1df7
commit 953e6511ee
2 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,7 @@ ERROR: bad-escape char ;
{ char: \} char: \} } { char: \} char: \} }
{ char: \) char: \) } { char: \) char: \) }
{ char: \' char: \' } { char: \' char: \' }
{ char: \# char: \# }
} ?at [ bad-escape ] unless ; } ?at [ bad-escape ] unless ;
INITIALIZED-SYMBOL: name>char-hook [ INITIALIZED-SYMBOL: name>char-hook [

View File

@ -383,7 +383,7 @@ DEFER: lex-factor-top*
: lex-factor-fallthrough ( string n/f slice/f ch/f -- string n'/f literal ) : 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-backslash ] }
{ char: \[ [ read-bracket ] } { char: \[ [ read-bracket ] }
{ char: \{ [ read-brace ] } { char: \{ [ read-brace ] }
@ -391,6 +391,7 @@ DEFER: lex-factor-top*
{ char: \] [ ] } { char: \] [ ] }
{ char: \} [ ] } { char: \} [ ] }
{ char: \) [ ] } { char: \) [ ] }
{ f [ ] } ! end of stream
{ char: \" [ read-string ] } { char: \" [ read-string ] }
{ char: \! [ read-exclamation ] } { char: \! [ read-exclamation ] }
{ char: > [ { char: > [
@ -399,7 +400,6 @@ DEFER: lex-factor-top*
[ slice-til-whitespace drop ] dip ?span-slices [ slice-til-whitespace drop ] dip ?span-slices
] unless ] unless
] } ] }
{ f [ ] }
! foo{abc}s -- the ``s`` here is fine ! foo{abc}s -- the ``s`` here is fine
! any character that is not special is fine here ! any character that is not special is fine here
[ drop ] [ drop ]