fix(format): execute write argument lines as Perl expressions - #1368
Open
fglock wants to merge 33 commits into
Open
fix(format): execute write argument lines as Perl expressions#1368fglock wants to merge 33 commits into
fglock wants to merge 33 commits into
Conversation
Evaluate each format argument line in list context when write reaches its picture, retaining operator evaluation and expression side effects. Add a system-Perl-validated regression test and update the core-suite design tracking with the remaining write.t boundary. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat @ and ^ as part of the physical format field width and advance through the template by that complete span. This restores @<< output width and fixes ten op/write.t assertions. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Recognize 0 numeric picture glyphs and preserve their full physical picture width when formatting values. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Recognize a bare @ format picture as a one-character text field. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Do not package-qualify an empty active format name before reporting it. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Match Perl formline behavior by consuming one terminal record separator from an @* value before following literal picture text. Add focused coverage and record the resulting op/write.t reduction. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Recognize decimal formline pictures, preserve a trailing literal picture dot, and use number signs for numeric overflow. Cover the Perl-compatible behavior with a focused formline regression. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Separate the caller-provided format name from its qualified lookup key so undefined-format errors match Perl for bare and NUL-prefixed names. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Emit the record separator after a declared format's final picture line while keeping formline accumulation separator-free. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Honor explicitly localized top-format names during write and report missing top formats with their caller-facing names. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Retain scalar slots across ^ picture lines and ~~ repeats so write consumes text continuation operands while preserving significant numeric caret padding. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Render signs, zero padding, and decimal pictures within their complete Perl format field widths. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Carry visible lexical scalar cells through format registration so write uses the declaration scope rather than empty package globals. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Preserve a hyphen on the current continuation picture line and consume the following text on the next repeated record. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Do not backtrack to an earlier blank when a continuation field ends directly before a whitespace boundary. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat ellipses following a continuation picture as conditional truncation markers and keep ordinary text pictures to one physical record. Add focused coverage for ellipsis consumption, trailing whitespace, and terminal input newlines. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Wrap braced multiline format arguments in a do block before runtime eval so they retain format-block list semantics instead of becoming hash constructors. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Bind declaration-scope scalar, array, and hash cells when registering formats on both execution backends, including interpolated aggregate elements. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat a numeric-looking picture interrupted by whitespace as a lone sigil field followed by literal text, matching Perl format semantics. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Expose repeat-picture write failures in $@ while returning undef from eval without a deferred interpreter exception. Add a focused dual-backend regression. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat a terminal decimal point as part of a numeric picture so overflow spans the complete Perl field width on both format backends. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Let a repeated format line consume each hash pair until its iterator is empty, with regression coverage for both execution backends. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Parse asterisk format fields without consuming following literal picture characters, and render reference values atomically in fill-mode fields. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Render format control markers as picture-position whitespace so formline matches Perl for mixed continuation and repeat pictures. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Stop format rendering and return false from write when its argument line executes a bare return, matching Perl control-flow behavior. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Honor a temporary formline picture's final newline while preserving newline-free picture behavior. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Recognize bare temporary format fields before a tilde control and suppress their empty picture output and record separator. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Use the fetched tied scalar for formline picture text and taint provenance, avoiding a second stateful FETCH or overloaded stringification. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Advance the temporary format argument cursor after each picture line so a multiline formline consumes the operands intended for each line. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Render final literal lines in named formats with their record separator and discard eval-format declaration whitespace before the first picture. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Emit Perl's redefine-category warning before a defined format is replaced on the JVM and bytecode backends. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat a braced qword list as an anonymous hash when it is used for a direct hash dereference. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.com>
Treat a trailing picture comment as outside a braced format argument block so the argument retains code-block semantics. Generated with [Codex](https://openai.com/codex/) Co-Authored-By: Codex <codex@openai.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
writeformat argument lines as complete Perl expressions in list context.Verification
perl src/test/resources/unit/format_argument_line_execution.t./jperl src/test/resources/unit/format_argument_line_execution.t./jperl --interpreter src/test/resources/unit/format_argument_line_execution.tmakemake check-linkstimeout 600 ../../jperl op/write.tfromperl5_t/t(273 remaining explicit Not OK records; unchanged because its remaining failures are distinct field-rendering/lifecycle clusters)