parser: split out check-word-name.

db4
John Benediktsson 2015-08-14 19:46:09 -07:00
parent 3e9d80edf1
commit 2c41c913ee
1 changed files with 4 additions and 2 deletions

View File

@ -74,11 +74,13 @@ ERROR: number-expected ;
ERROR: invalid-word-name string ;
: scan-word-name ( -- string )
scan-token
: check-word-name ( string -- string )
dup "\"" = [ t ] [ dup string>number ] if
[ invalid-word-name ] when ;
: scan-word-name ( -- string )
scan-token check-word-name ;
: scan-new ( -- word )
scan-word-name create-word-in ;