Skip to content

feat(regex): preserve executable callback pseudo-block scope - #978

Merged
fglock merged 1 commit into
masterfrom
feature/phase36-callback-scope
Aug 16, 2026
Merged

feat(regex): preserve executable callback pseudo-block scope#978
fglock merged 1 commit into
masterfrom
feature/phase36-callback-scope

Conversation

@fglock

@fglock fglock commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • transfer executable-regex callback local() frames to matcher ownership for forward continuation and backtracking unwind
  • model callbacks as Perl pseudo-blocks for caller, __SUB__, and escaping control flow on JVM and interpreter backends
  • fix named-unary scalar precedence so a following match remains in scalar context
  • refresh the Phase 36 plans with the current direct baseline and remaining work

Validation

  • make — PASS (BUILD SUCCESSFUL in 3m 59s)
  • make check-links — PASS (0 errors)
  • new standard-Perl tests — PASS (15 assertions)
  • new JVM/interpreter tests plus existing callback exception/mutation gates — PASS in both backends
  • re/rxcode.t — 42/42
  • re/reg_eval_scope.t — 33/49 on JVM and interpreter (previously 22/49)

The remaining 16 reg_eval_scope.t failures are recorded in the plan: runtime/interpolated callback source and lexical re flags, recursive callback caller/source lines, interpolated qr// self identity, warning location, and the legacy escaped-callback diagnostic.

Transfer callback local() frames to matcher ownership so committed paths keep
their dynamic values while backtracking, failure, and exceptions unwind them.
Treat callback implementation CVs as pseudo-blocks for caller, __SUB__, and
escaping loop control, and keep named-unary scalar matches in scalar context.

Update the Phase 36 plans with the 33/49 reg_eval_scope.t baseline and the
remaining lexical pragma, recursive caller, and diagnostic work.

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

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock merged commit a0d5ffc into master Aug 16, 2026
0 of 2 checks passed
@fglock
fglock deleted the feature/phase36-callback-scope branch August 16, 2026 12:58
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