regexp.combinators: fix <char-range>.

locals-and-roots
John Benediktsson 2016-03-27 18:49:42 -07:00
parent 90994cc5d0
commit c1010144e5
1 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
USING: regexp sequences kernel regexp.negation regexp.ast
accessors fry regexp.classes ;
accessors fry regexp.classes strings ;
IN: regexp.combinators
<PRIVATE
@ -19,9 +19,8 @@ CONSTANT: <nothing> R/ (?~.*)/s
[ "\\Q" "\\E" surround ] [ <concatenation> ] bi make-regexp ; foldable
: <char-range> ( char1 char2 -- regexp )
[ [ "[" "-" surround ] [ "]" append ] bi* append ]
[ <range-class> ]
2bi make-regexp ;
[ [ 1string ] bi@ [ "[" "-" surround ] [ "]" append ] bi* append ]
[ <range-class> ] 2bi make-regexp ;
: <or> ( regexps -- disjunction )
[ [ raw>> "(" ")" surround ] map "|" join ]