Skip to content

feat(regex): make callback mutations transactional - #974

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

feat(regex): make callback mutations transactional#974
fglock merged 1 commit into
masterfrom
feature/phase36-callback-transactions

Conversation

@fglock

@fglock fglock commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • make ordinary scalar, array, and hash mutations from executable regex callbacks transactional at the matcher-attempt boundary
  • restore callback-visible state when the overall match fails or a callback throws, while retaining mutations when the match succeeds
  • hide internal callback IDs from regex stringification without breaking embedded callback remapping
  • update the Phase 36 plan to record the recovered callback baseline and remaining scope/caller/control-flow work

Compatibility

  • perl5_t/t/re/rxcode.t: 42/42 (previously 39/42)
  • perl5_t/t/re/reg_eval_scope.t: 22/49, unchanged and documented as the next Stage 36.4 slice
  • failed overall matches roll back ordinary callback mutations
  • successful matches retain mutations from both abandoned and selected alternatives, matching system Perl

Validation

  • make — PASS
  • system Perl: callback_mutation_rollback.t — 9/9
  • JVM and interpreter: callback_mutation_rollback.t — 9/9 each
  • system Perl: callback_stringification.t — 2/2
  • JVM and interpreter: callback_stringification.t — 2/2 each
  • focused upstream runner: rxcode.t 42/42; reg_eval_scope.t 22/49; no timeout or incomplete file

Snapshot ordinary callback-visible scalar, array, and hash state for each
matcher attempt. Restore it when the overall match fails or a callback throws,
while preserving Perl's committed mutations when another alternative succeeds.

Hide internal callback IDs from regex stringification without breaking callback
remapping for embedded patterns. Add standard-Perl-valid regression coverage
and update the Phase 36 delivery plan with the verified 42/42 rxcode baseline.

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

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock merged commit 5f6c842 into master Aug 16, 2026
2 of 4 checks passed
@fglock
fglock deleted the feature/phase36-callback-transactions branch August 16, 2026 11:44
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