]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/multiline/multiline.factor
multiline: adding (( )) comments.
[factor.git] / basis / multiline / multiline.factor
index 11f75636fbea48f3accf5d4e40e61dae801ad80f..c6d5576347a7122ed29eab33f6b27b209e756b57 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2007 Daniel Ehrenberg
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators kernel lexer locals make math
-namespaces parser quotations sequences strings.parser.private
-words ;
+USING: accessors kernel lexer make math namespaces parser
+quotations sequences strings.parser.private words ;
 IN: multiline
 
 <PRIVATE
@@ -41,10 +40,10 @@ SYNTAX: STRING:
 :: (scan-multiline-string) ( i end lexer -- j )
     lexer line-text>> :> text
     lexer still-parsing? [
-        end text i subseq-start-from [| j |
+        i text end subseq-index-from [| j |
             i j text subseq % j end length +
         ] [
-            text i short tail % CHAR: \n ,
+            text i index-or-length tail % CHAR: \n ,
             lexer next-line
             0 end lexer (scan-multiline-string)
         ] if*
@@ -67,6 +66,8 @@ PRIVATE>
 
 SYNTAX: /* "*/" parse-multiline-string drop ;
 
+SYNTAX: (( "))" parse-multiline-string drop ;
+
 SYNTAX: [[ "]]" parse-multiline-string suffix! ;
 SYNTAX: [=[ "]=]" parse-multiline-string suffix! ;
 SYNTAX: [==[ "]==]" parse-multiline-string suffix! ;