]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp: Fix / escape in regexp. Fixes validators test.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 31 Mar 2016 06:28:12 +0000 (23:28 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 31 Mar 2016 06:28:12 +0000 (23:28 -0700)
basis/regexp/prettyprint/prettyprint.factor
basis/regexp/regexp.factor

index 2405677b1f851c8014912a6db389af026309927d..372ef69062f83f16d68c35d9f9b5b55e92872df5 100644 (file)
@@ -7,7 +7,7 @@ IN: regexp.prettyprint
 M: regexp pprint*
     [
         [
-            [ raw>> "R/ " % % "/" % ]
+            [ raw>> "\\/" "\\\\/" replace "R/ " % % "/" % ]
             [ options>> options>string % ] bi
         ] "" make
     ] keep present-text ;
index d50909ba2b165e6da28e628f58af1b6236c14a48..ff383b272b6990ca7a15ed6b7177c5f274eb081e 100644 (file)
@@ -211,7 +211,7 @@ PRIVATE>
     dup still-parsing-line? [ (parse-raw) ] [ drop f ] if ;
 
 : parse-regexp ( accum -- accum )
-    lexer get [ take-until ] [ parse-noblank-token ] bi
+    lexer get [ take-until "\\/" "/" replace ] [ parse-noblank-token ] bi
     <optioned-regexp> compile-next-match suffix! ;
 
 PRIVATE>