Skip to content

Commit

Permalink
Implement ? and + in regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jul 24, 2010
1 parent 6d24c27 commit b417e13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions RegexEngine.pm6
Expand Up @@ -77,6 +77,14 @@ sub _rxstar($C, $sub) is export {
_rxone($C));
}

sub _rxopt($C, $sub) is export {
_rxdisj($sub($C), _rxone($C))
}

sub _rxplus($C, $sub) is export {
_rxlazymap($sub($C), sub ($C) { _rxstar($C, $sub) })
}

sub _rxstr($C, $str) is export {
#say "_rxstr : " ~ ($C.str ~ (" @ " ~ ($C.from ~ (" ? " ~ $str))));
if $C.from + $str.chars <= $C.str.chars &&
Expand Down

0 comments on commit b417e13

Please sign in to comment.