regexp: Fix / escape in regexp. Fixes validators test.

locals-and-roots
Doug Coleman 2016-03-30 23:28:12 -07:00
parent 30d158ccce
commit f5cea754b5
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ IN: regexp.prettyprint
M: regexp pprint*
[
[
[ raw>> "R/ " % % "/" % ]
[ raw>> "\\/" "\\\\/" replace "R/ " % % "/" % ]
[ options>> options>string % ] bi
] "" make
] keep present-text ;

View 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>