Skip to content

Commit

Permalink
add $*SUPPOSING dynvar to mark conjectural parsing
Browse files Browse the repository at this point in the history
This dynvar is set inside <?before> and <?after> so that action methods can
decide whether to do permanent side effects outside the AST.
  • Loading branch information
TimToady committed Aug 3, 2016
1 parent 99aa515 commit e0e113d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/QRegex/Cursor.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ role NQPCursorRole is export {
}

method before($regex, $off = 0) {
my $*SUPPOSING := 1;
my int $orig_highwater := nqp::getattr_i($!shared, ParseShared, '$!highwater');
my $orig_highexpect := nqp::getattr($!shared, ParseShared, '@!highexpect');
nqp::bindattr($!shared, ParseShared, '@!highexpect', nqp::list_s());
Expand All @@ -596,6 +597,7 @@ role NQPCursorRole is export {
# Expects to get a regex whose syntax tree was flipped during the
# compile.
method after($regex) {
my $*SUPPOSING := 1;
my int $orig_highwater := nqp::getattr_i($!shared, ParseShared, '$!highwater');
my $orig_highexpect := nqp::getattr($!shared, ParseShared, '@!highexpect');
nqp::bindattr($!shared, ParseShared, '@!highexpect', nqp::list_s());
Expand Down

0 comments on commit e0e113d

Please sign in to comment.