Add some error checking to CHAR:

db4
Slava Pestov 2008-11-23 00:25:01 -06:00
parent c2c07f8b22
commit 51787c2022
2 changed files with 3 additions and 1 deletions

View File

@ -498,3 +498,5 @@ DEFER: blah
[ error>> error>> def>> \ blah eq? ] must-fail-with
[ ] [ f lexer set f file set "Hello world" note. ] unit-test
[ "CHAR: \\u9999999999999" eval ] must-fail

View File

@ -62,7 +62,7 @@ IN: bootstrap.syntax
"CHAR:" [
scan {
{ [ dup length 1 = ] [ first ] }
{ [ "\\" ?head ] [ next-escape drop ] }
{ [ "\\" ?head ] [ next-escape >string "" assert= ] }
[ name>char-hook get call ]
} cond parsed
] define-syntax