]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "regexp: slightly more complicated tokenization to handle another case."
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 18 Mar 2019 17:42:29 +0000 (10:42 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 18 Mar 2019 17:42:29 +0000 (10:42 -0700)
This reverts commit 9f0bce762259878c63d15ef171c17931276c066e.

basis/regexp/regexp.factor

index 14310ddc306b2e2c84ed0101962786b8185262da..c31571c718711f02bec2549ec94bd848a02afc49 100644 (file)
@@ -197,27 +197,11 @@ PRIVATE>
 
 <PRIVATE
 
-:: (take-until) ( col line end -- col' line )
-    "\\" end suffix :> tokens
-    col line [
-        [ [ tokens member? ] find-from ] keep swap [
-            CHAR: \ = [ [ 2 + ] dip t ] [ [ 1 + ] dip f ] if
-        ] [
-            "Unterminated regexp" throw
-        ] if*
-    ] loop ;
-
-:: take-until ( lexer -- string )
-    lexer skip-blank
-    lexer [
+: take-until ( lexer -- string )
+    dup skip-blank [
         dupd [
-            [ [ "[(\\/" member? ] find-from ] keep swap [
-                {
-                    { CHAR: [ [ CHAR: ] (take-until) t ] }
-                    { CHAR: ( [ CHAR: ) (take-until) t ] }
-                    { CHAR: \ [ [ 2 + ] dip t ] }
-                    { CHAR: / [ f ] }
-                } case
+            [ [ "\\/" member? ] find-from ] keep swap [
+                CHAR: \ = [ [ 2 + ] dip t ] [ f ] if
             ] [
                 "Unterminated regexp" throw
             ] if*