]> gitweb.factorcode.org Git - factor.git/commitdiff
multiline: lexer-eof? is just still-parsing?.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 20 May 2014 04:38:54 +0000 (21:38 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 20 May 2014 04:38:54 +0000 (21:38 -0700)
basis/multiline/multiline.factor

index 38d0be7ded301d610578595ab5e4dd8ad043d2f5..069c594b0dddb86b667f221691927fa662642d13 100644 (file)
@@ -11,15 +11,15 @@ ERROR: bad-heredoc identifier ;
 : rest-of-line ( lexer -- seq )
     [ line-text>> ] [ column>> ] bi tail ;
 
-: next-line-text ( lexer -- str )
-    [ next-line ] [ line-text>> ] bi ;
+: next-line-text ( lexer -- str )
+    [ next-line ] [ line-text>> ] [ still-parsing? ] tri ;
 
 : (parse-here) ( lexer -- )
     dup next-line-text [
         dup ";" =
         [ drop next-line ]
         [ % CHAR: \n , (parse-here) ] if
-    ] [ drop ";" throw-unexpected-eof ] if* ;
+    ] [ ";" throw-unexpected-eof ] if ;
 
 PRIVATE>
 
@@ -39,12 +39,9 @@ SYNTAX: STRING:
 
 <PRIVATE
 
-: lexer-eof? ( lexer -- ? )
-    [ line>> ] [ text>> length ] bi <= ;
-
 :: (scan-multiline-string) ( i end lexer -- j )
     lexer line-text>> :> text
-    lexer lexer-eof? [
+    lexer still-parsing? [
         end text i start* [| j |
             i j text subseq % j end length +
         ] [