]> gitweb.factorcode.org Git - factor.git/commitdiff
lexer, parser: Rename unexpected-eof.
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 04:35:50 +0000 (21:35 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 04:35:50 +0000 (21:35 -0700)
core/lexer/lexer.factor
core/parser/parser.factor

index 1e9c7a28c29314cfb28654caa1bac280bd2a0979..53f2a9ddee765b846bba7c0f9016d9885bf1694c 100644 (file)
@@ -108,9 +108,10 @@ M: lexer skip-word ( lexer -- )
 
 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 ;
index a212868dd33318db4d47403d22c23520e5075573..266f4c77ecde9ba0705b3012cddb85746a65d5c6 100644 (file)
@@ -63,7 +63,7 @@ ERROR: number-expected ;
     (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 ;
@@ -106,7 +106,7 @@ ERROR: staging-violation 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 ]