Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use a singleton FailCursor for all parsing.
  • Loading branch information
timo committed Sep 19, 2013
1 parent f9578fe commit 3314cf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/QRegex/Cursor.nqp
Expand Up @@ -7,6 +7,8 @@ my class ParseShared is export {
has %!marks;
}

my $FailCursor;

role NQPCursorRole is export {
has $!shared;
has int $!from;
Expand Down Expand Up @@ -201,9 +203,7 @@ role NQPCursorRole is export {
$!restart(self);
}
else {
my $cur := self."!cursor_start_cur"();
$cur."!cursor_fail"();
$cur
$FailCursor;
}
}

Expand Down Expand Up @@ -596,6 +596,8 @@ role NQPCursorRole is export {
}
}

my class FailCursor does NQPCursorRole { }
$FailCursor := FailCursor.new."!cursor_fail"();

class NQPMatch is NQPCapture {
has $!orig;
Expand Down

0 comments on commit 3314cf5

Please sign in to comment.