Skip to content

fix(regex): preserve control-verb trie boundaries - #1363

Merged
fglock merged 3 commits into
masterfrom
fix/regexp-t
Sep 13, 2026
Merged

fix(regex): preserve control-verb trie boundaries#1363
fglock merged 3 commits into
masterfrom
fix/regexp-t

Conversation

@fglock

@fglock fglock commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve Perl PRUNE/SKIP/COMMIT boundaries through nested regex alternatives
  • retain the original branch position when THEN crosses a common-prefix trie boundary
  • add direct Joni and Perl-level regression coverage for perl5_t/t/re/regexp.t

Validation

  • make
  • make check-links
  • prove src/test/resources/unit/regex/control_verb_trie_boundary.t
  • ./jperl src/test/resources/unit/regex/control_verb_trie_boundary.t
  • ./jperl --interpreter src/test/resources/unit/regex/control_verb_trie_boundary.t
  • cd perl5_t && ../jperl t/re/regexp.t
  • cd perl5_t && ../jperl --interpreter t/re/regexp.t

fglock and others added 3 commits September 13, 2026 09:44
Keep PRUNE and SKIP within their innermost syntactic branch, make COMMIT
discard all pending alternatives, and preserve the original branch position
when THEN crosses a common-prefix trie boundary.

Fixes perl5_t/t/re/regexp.t control-verb cases on JVM and interpreter.

Generated with [OpenAI Codex](https://openai.com/codex)

Co-Authored-By: OpenAI Codex <codex@openai.com>
Mark source alternatives that contain PRUNE or SKIP so those verbs preserve
only enclosing alternatives. Continue cutting ordinary alternatives and
quantifier retries after a completed nested group.

Restores re/pat_advanced.t and re/pat_advanced_thr.t on both backends.

Generated with [OpenAI Codex](https://openai.com/codex)

Co-Authored-By: OpenAI Codex <codex@openai.com>
Do not mark enclosing alternations merely because a nested branch contains
PRUNE or SKIP. Preserve the immediate source alternation boundary so a nested
SKIP reaches the enclosing COMMIT without skipping to a false positive.

Restores perl5_t/t/re/regexp.t to 2290/2290 on both backends.

Generated with [OpenAI Codex](https://openai.com/codex)

Co-Authored-By: OpenAI Codex <codex@openai.com>
@fglock
fglock merged commit ab543a3 into master Sep 13, 2026
2 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.

1 participant