Put bad escape code in the bad-escape error

db4
Slava Pestov 2009-09-23 17:55:54 -05:00
parent 1788957e1d
commit 413dc67985
2 changed files with 5 additions and 3 deletions

View File

@ -319,7 +319,9 @@ M: lexer-error error-help
M: bad-effect summary M: bad-effect summary
drop "Bad stack effect declaration" ; drop "Bad stack effect declaration" ;
M: bad-escape summary drop "Bad escape code" ; M: bad-escape error.
"Bad escape code: \\" write
char>> 1string print ;
M: bad-literal-tuple summary drop "Bad literal tuple" ; M: bad-literal-tuple summary drop "Bad literal tuple" ;

View File

@ -5,7 +5,7 @@ namespaces parser sequences splitting strings arrays
math.order ; math.order ;
IN: strings.parser IN: strings.parser
ERROR: bad-escape ; ERROR: bad-escape char ;
: escape ( escape -- ch ) : escape ( escape -- ch )
H{ H{
@ -19,7 +19,7 @@ ERROR: bad-escape ;
{ CHAR: 0 CHAR: \0 } { CHAR: 0 CHAR: \0 }
{ CHAR: \\ CHAR: \\ } { CHAR: \\ CHAR: \\ }
{ CHAR: \" CHAR: \" } { CHAR: \" CHAR: \" }
} at [ bad-escape ] unless* ; } ?at [ bad-escape ] unless ;
SYMBOL: name>char-hook SYMBOL: name>char-hook