fix: honor Storable Deparse for code references - #876
Open
fglock wants to merge 3 commits into
Open
Conversation
Allow the native Storable writer to serialize Perl code references when Storable::Deparse is enabled, using compiler-retained source text. Add a unit regression test validated against standard Perl. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Use the anonymous subroutine token index when retaining source text for Storable::Deparse. The block child index can point at a later enclosing block, causing adjacent closures to serialize the wrong source and breaking Struct::Diff and JSON::Patch comparisons. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Record the exclusive closing-token index for parsed anonymous subs and carry the resulting source span into RuntimeCode. Storable can then serialize the exact compiler span without attempting to parse Perl delimiters at runtime. Expand the regression coverage for quote-like braces and adjacent closures. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Storable::Deparsein the shared Java Storable writer for pure-Perl code references.Verification
prove src/test/resources/unit/storable_code_deparse.t— passmake— compilation completed; full parallel test output was still running when the tool session ended.timeout 300 ./jcpan -t Struct::Diff— code-reference freeze failures removed; remaining failures are separate reference/lvalue cases.Generated with Codex