Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to re-obtain the cursor class
That seems to help in !cursor_capture, but not for !protoregex. It looks like the
call to self."$rxname"() explodes...
  • Loading branch information
FROGGS committed Jun 5, 2014
1 parent 0820d91 commit d3566fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/QRegex/Cursor.nqp
Expand Up @@ -229,7 +229,8 @@ role NQPCursorRole is export {
$!match := nqp::null();
$!cstack := [] unless nqp::defined($!cstack);
nqp::push($!cstack, $capture);
nqp::bindattr($capture, $?CLASS, '$!name', $name);
my $class := nqp::getattr($!shared, ParseShared, '$!CUR_CLASS');
nqp::bindattr($capture, $class, '$!name', $name);
nqp::push_i($!bstack, 0);
nqp::push_i($!bstack, $!pos);
nqp::push_i($!bstack, 0);
Expand Down Expand Up @@ -321,8 +322,12 @@ role NQPCursorRole is export {
while @fates {
$rxname := nqp::atpos(@rxfate, nqp::pop_i(@fates));
#nqp::say("invoking $rxname");

$cur := self."$rxname"();
@fates := @EMPTY if nqp::getattr_i($cur, $?CLASS, '$!pos') >= 0;

my $shared := nqp::getattr($cur, $?CLASS, '$!shared');
my $class := nqp::getattr($shared, ParseShared, '$!CUR_CLASS');
@fates := @EMPTY if nqp::getattr_i($cur, $class, '$!pos') >= 0;
}
$cur // nqp::getattr($shared, ParseShared, '$!fail_cursor');
}
Expand Down

0 comments on commit d3566fd

Please sign in to comment.