Merge branch 'master' of git://factorcode.org/git/factor
commit
4ab91ee742
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors hashtables kernel math state-tables vars vectors ;
|
||||
USING: accessors hashtables kernel math state-tables vectors ;
|
||||
IN: regexp.backend
|
||||
|
||||
TUPLE: regexp
|
||||
|
|
|
@ -294,6 +294,7 @@ ERROR: unrecognized-escape char ;
|
|||
read1
|
||||
{
|
||||
{ CHAR: \ [ CHAR: \ <constant> ] }
|
||||
{ CHAR: / [ CHAR: / <constant> ] }
|
||||
{ CHAR: ^ [ CHAR: ^ <constant> ] }
|
||||
{ CHAR: $ [ CHAR: $ <constant> ] }
|
||||
{ CHAR: - [ CHAR: - <constant> ] }
|
||||
|
|
|
@ -55,6 +55,10 @@ IN: regexp-tests
|
|||
[ t ] [ " " "[\\W]" <regexp> matches? ] unit-test
|
||||
[ f ] [ "a" "[\\W]" <regexp> matches? ] unit-test
|
||||
|
||||
[ t ] [ "/" "\\/" <regexp> matches? ] unit-test
|
||||
|
||||
[ t ] [ "a" R' a'i matches? ] unit-test
|
||||
|
||||
[ t ] [ "" "a|b*|c+|d?" <regexp> matches? ] unit-test
|
||||
[ t ] [ "a" "a|b*|c+|d?" <regexp> matches? ] unit-test
|
||||
[ t ] [ "c" "a|b*|c+|d?" <regexp> matches? ] unit-test
|
||||
|
|
|
@ -28,7 +28,7 @@ IN: regexp
|
|||
: match ( string regexp -- pair )
|
||||
<dfa-traverser> do-match return-match ;
|
||||
|
||||
: match* ( string regexp -- pair )
|
||||
: match* ( string regexp -- pair captured-groups )
|
||||
<dfa-traverser> do-match [ return-match ] [ captured-groups>> ] bi ;
|
||||
|
||||
: matches? ( string regexp -- ? )
|
||||
|
@ -129,8 +129,6 @@ IN: regexp
|
|||
: option? ( option regexp -- ? )
|
||||
options>> key? ;
|
||||
|
||||
USE: multiline
|
||||
/*
|
||||
M: regexp pprint*
|
||||
[
|
||||
[
|
||||
|
@ -139,4 +137,3 @@ M: regexp pprint*
|
|||
case-insensitive swap option? [ "i" % ] when
|
||||
] "" make
|
||||
] keep present-text ;
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue