Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix implementation of <before ...>.
  • Loading branch information
jnthn committed Nov 18, 2011
1 parent 3071d43 commit 7fc7a08
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/QRegex/Cursor.nqp
Expand Up @@ -198,12 +198,14 @@ role NQPCursorRole {
}

method before($regex) {
my $cur := self.'!cursor_start'();
$cur.'!cursor_pass'($!pos, 'before')
if $regex($cur);
my $cur := self."!cursor_start"();
nqp::bindattr_i($cur, $?CLASS, '$!pos', $!pos);
nqp::getattr_i($regex($cur), $?CLASS, '$!pos') >= 0 ??
$cur."!cursor_pass"($!pos, 'before') !!
$cur."!cursor_fail"();
$cur;
}

method ws() {
# skip over any whitespace, fail if between two word chars
my $cur := self."!cursor_start"();
Expand Down

0 comments on commit 7fc7a08

Please sign in to comment.