Skip to content

Fall back to any-args when an expr does not reach the closing paren - #13

Merged
dwarring merged 1 commit into
css-raku:masterfrom
ugexe:sigspace-ratchet
Sep 21, 2026
Merged

dwarring merged 1 commit into
css-raku:masterfrom
ugexe:sigspace-ratchet

Conversation

@ugexe

@ugexe ugexe commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

In [ <expr>? || <any-args> ] the first branch always succeeds, so any- args is only reached by backtracking into the alternation once the ')' fails. That only works because an alternation followed by whitespace in a rule is currently not ratcheted, which rakudo may change in the future. Requiring the ')' after the expr keeps the fallback reachable either way.

In `[ <expr>? || <any-args> ]` the first branch always succeeds, so any-
args is only reached by backtracking into the alternation once the ')'
fails. That only works because an alternation followed by whitespace in
a rule is currently not ratcheted, which rakudo may change in the
future. Requiring the ')' after the expr keeps the fallback reachable
either way.
@dwarring
dwarring merged commit f71a46c into css-raku:master Sep 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants