Skip to content

feat(regex): implement (*ACCEPT) in vendored Joni - #972

Merged
fglock merged 1 commit into
masterfrom
feature/joni-accept-control-verb
Aug 16, 2026
Merged

feat(regex): implement (*ACCEPT) in vendored Joni#972
fglock merged 1 commit into
masterfrom
feature/joni-accept-control-verb

Conversation

@fglock

@fglock fglock commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • parse (*ACCEPT) as a native vendored-Joni control-verb AST node and opcode
  • preserve Perl boundaries for top-level matches, subpattern calls, positive lookaheads, and runtime dynamic patterns
  • close captures at the accepted endpoint and complete abandoned dynamic/backtracking continuations exactly once
  • route ACCEPT-bearing patterns to Joni and bypass mandatory-suffix optimization when control flow can skip that suffix
  • update the history-free Joni design and regex feature matrix

All new vendored-Joni sources retain the upstream MIT notice. Existing org.joni source namespaces remain unchanged; standalone packaging continues to relocate them to org.perlonjava.internal.joni.

Validation

  • prove src/test/resources/unit/regex/accept_control_verb.t: 13/13 on standard Perl
  • JVM backend: 13/13
  • interpreter backend: 13/13
  • imported Joni tests: pass, including dedicated ACCEPT cases
  • make: pass, no warnings
  • focused upstream direct/thread pair: 24/555 passing and 30/555 executed in each file, up from 22 passing and 28 executed before this slice; next blocker is optimistic callback conditions at line 138
  • full perl dev/tools/perl_test_runner.pl perl5_t/t/re/: 80 files, 50,718 passing assertions, zero timeouts

Baseline comparison

Compared file-by-file with ../PerlOnJava/logs/test_20260815_080000_958.log:

  • 26 regex files improved
  • 53 retained the same passing count
  • no files are missing or newly added
  • regexp_unicode_prop.t is 1019/1110 versus the historical 1031/1110; a detached, clean origin/master build reproduces the same 1019/1110 result, so this is inherited from merged main and is not introduced by this branch

The ACCEPT-specific gain is visible in both pat_re_eval.t and pat_re_eval_thr.t, which move from the PR 970 postbase 22/555 to 24/555.

Generated with Codex

Parse (*ACCEPT) as a native matcher-control opcode and preserve Perl's
top-level, subpattern-call, positive-lookahead, and dynamic-program
boundaries. Close captures at the accepted endpoint, discard abandoned
backtracking continuations, and route ACCEPT-bearing patterns to Joni.

Disable mandatory-suffix optimization for control-verb programs because
the accepted control-flow path can make that suffix unreachable. Extend
positive-lookahead frames with their continuation target so ACCEPT can
resume the enclosing matcher correctly.

Add standard-Perl differential coverage and vendored-Joni unit coverage.
Update the Joni design and regex feature matrix.

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

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock merged commit f11a456 into master Aug 16, 2026
2 checks passed
@fglock
fglock deleted the feature/joni-accept-control-verb branch August 16, 2026 08:59
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