Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to implement <before>
It seems a bit wrong since it never captures, but it does look-ahead
  • Loading branch information
moritz committed Oct 27, 2011
1 parent 1f3891e commit fa9f991
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/QRegex/Cursor.nqp
Expand Up @@ -142,6 +142,13 @@ role NQPCursorRole {
if nqp::substr($!target, $!pos, $litlen) eq $str;
$cur;
}

method before($regex) {
my $cur := self.'!cursor_start'();
$cur.'!cursor_pass'($!pos, 'before')
if $regex($cur);
$cur;
}

method ws() {
# skip over any whitespace, fail if between two word chars
Expand Down

0 comments on commit fa9f991

Please sign in to comment.