Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2008-11-18 16:16:41 -06:00
commit 4ab91ee742
7 changed files with 7 additions and 5 deletions

View File

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

View File

@ -294,6 +294,7 @@ ERROR: unrecognized-escape char ;
read1
{
{ CHAR: \ [ CHAR: \ <constant> ] }
{ CHAR: / [ CHAR: / <constant> ] }
{ CHAR: ^ [ CHAR: ^ <constant> ] }
{ CHAR: $ [ CHAR: $ <constant> ] }
{ CHAR: - [ CHAR: - <constant> ] }

View File

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

View File

@ -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 ;
*/