They're fun, because they are parsed by the parse_enumcharclass subroutine, since that is the one catching 'term:<+' things.
Had to implement actual zerowidth and negated semantics for this to work.
Also introduced the <?wb>, syntax, again without actually making it semantically distinct from <wb>. Seems to pass a lot of tests so far. :P
For the time being, I just made them synonymous with the capturing ones, i.e. even <.subrule> will capture. Let's see if the PGE tests catch this. If not, I have an idea about making tests for matching against the absence of things in a match object.
It's naive because it doesn't backtrack. On the other hand, we don't backtrack into subrules yet, so it doesn't matter right now.
Already compiled regexes are re-used if chanced upon again. This kind of optimization matters now that we compile the regexes.
We no longer use TreeSpider to execute the regular expression. Instead, the required Perl 6 code is generated and then compiled. After this change, all of the old tests pass, and a few more to boot.
The $!pos variable should be restored not just upon BACKTRACK, but also upon FAIL and FAIL_GROUP, after the savepoints refactor.
This helps emulate Perl 5 numbering, as in /$1=[(.) (.)] (.)/. This creates four captures $1, $2, $3, and $4. $1 corresponds to [(.) (.)]. It's a Group syntactically, but it gets forced into being a CGroup, and has its 'isscope' property set to False. Thus, the $2 and $3 captures, despite being nested directly inside this CGroup, end up being attached to the level above, the entire match object.
Ok, so savepoints are no longer stored in association with the tree, but instead in one single stack in the TreeSpider object. This resulted in a whole musical chairs of other changes: - The specially included GGE::Exp::Regex is now gone, no longer needed to host the top-level backtracking savepoints. - Cut groups and ratchety quantifiers need to modify the stack of savepoints, because (respectively), a FAIL_GROUP means that the group should not attempt to backtrack into itself, and a ratchet modifier means that the quantifier should not attempt to backtrack into itself. - Previously, GGE::Exp::Alt could get away with backtracking as soon as it failed. This is no longer so; all nodes need to fail upwards rather than backtracking themselves. Among all the listed changes, this is the only simplifying one.
It did before. Well, the things that got back a Failure after processing the WS cried, because they thought it was a GGE::Exp of some sort and tried to call methods on it accordingly.
The savepoints were unregistered too soon -- at re-descent, not at match success. I'm further suspecting that I have the whole backtracking paradigm wrong (again), and I'm now going to check that.
These should not be 'scopes', however, since they're not based in the world of syntax. Stand by for next commit.