PREDICATE: unexpected-eof < unexpected got>> not ;
-: unexpected-eof ( word -- * ) f unexpected ;
+: throw-unexpected-eof ( word -- * ) f unexpected ;
-: scan-token ( -- str ) (scan-token) [ "token" unexpected-eof ] unless* ;
+: scan-token ( -- str )
+ (scan-token) [ "token" throw-unexpected-eof ] unless* ;
: expect ( token -- )
scan-token 2dup = [ 2drop ] [ unexpected ] if ;
(scan-token) dup [ parse-datum ] when ;
: scan-datum ( -- word/number )
- (scan-datum) [ \ word unexpected-eof ] unless* ;
+ (scan-datum) [ \ word throw-unexpected-eof ] unless* ;
: scan-word ( -- word )
(scan-token) parse-word ;
: parse-until-step ( accum end -- accum ? )
(scan-datum) {
{ [ 2dup eq? ] [ 2drop f ] }
- { [ dup not ] [ drop unexpected-eof t ] }
+ { [ dup not ] [ drop throw-unexpected-eof t ] }
{ [ dup delimiter? ] [ unexpected t ] }
{ [ dup parsing-word? ] [ nip execute-parsing t ] }
[ pick push drop t ]