Make backtracking modifiers on alternations work correctly #368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Current Rakudo behavior:
?
*
+
**
|
||
With this pull request, the behavior becomes "yes" for all 24 cases.
Implementation
Please review carefully, because these are my first commits to nqp and my understanding of this code base is limited... 馃槂
I basically just copied the existing no-backtrack handling code from
method alt
tomethod altseq
in both the MoarVM and JVM backend (263257a), and fixed a thinko in thequantified_atom
action method where the "backtrack" flag for alternation atoms is set in the first place (ba165c8).RT & SYN
This fixes:
It also matches the behavior intended for these backtracking modifiers by S05, as I understand it.
Roast
This PR passed
make spectest
on my machine (Linux/MoarVM) .One it's merged, I'd suggest adding the following additional tests to roast:
Of these tests, the following three fail without this PR:
With this PR applied, all 24 tests succeed.