Repository navigation
render-pipeline: @ is a letter inside \makeatletter for column-switch scan (#801) - #817
Merged
Merged
Conversation
… scan (#801) `columns.rs`'s definition-body skipping (`definition_end`/`skip_control_or_group`) scanned control-word names as ASCII letters only, so under `\makeatletter` a name containing `@` wasn't recognised as a definition target: `\let\@oldtc\twocolumn` stopped after the `\@` control symbol, leaving `oldtc\twocolumn` to fall through as if `\twocolumn` were genuinely invoked — a one-column article incorrectly rendered two-column with no diagnostic. Same gap for the brace-less `\newcommand\@x\twocolumn` form. Added `is_name_char`/`control_word_end`, and a boolean `in_makeat` toggle (pdflatex errors on unmatched `\makeatletter`/`\makeatother`, so nesting isn't a real concept) tracked as `switches()` walks the document and threaded into `definition_end`/`skip_control_or_group`/`skip_one_token` — one fix point covers `\let`, the `\newcommand` family, the `\def` family and the `\newenvironment` family. `switches()`'s own `\twocolumn`/ `\onecolumn` match now reuses the same state-aware word scan. Left out of scope (follow-up): the issue's ".sty/.cls always treat @ as a letter" part — `ColumnMode::scan` is called with only the entry document's text, no file-kind signal reaches this scanner yet. The related `\let`-saved-switch `unknown_command` note is explicitly out of scope per the issue. Tests: at_names_in_makeatletter_definitions_do_not_switch (both issue cases plus \onecolumn/\def variants), at_outside_makeatletter_does_not_ swallow_a_switch (negative control — pdflatex itself errors there, so the existing "leak" behavior is preserved), makeatother_closes_the_at_region. Mutation check: forcing the old (pre-fix) call sites makes the first new test fail while the rest pass; restoring the fix, all 19 columns tests pass. Full `cargo test` in crates/render-pipeline (independently re-run by the supervisor): all suites ok, 0 failed (lib 190 passed, 1 pre-existing ignore; every integration binary ok including twocolumn_command 7/7, twocolumn_banner 13/13, twocolumn_geometry_option 4/4). Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane columns-atname-scan, slice 1) Commit-Executor: daniel-muse-lead (Claude Sonnet) Reviewed-by: daniel-muse-lead (Claude Sonnet) Co-authored-by: d-q222 <[email protected]>
Contributor
Author
|
Commander (daniel-parent): independent Opus review of PR #817 review (head 653addc)render-pipeline: @ is a letter inside \makeatletter for column-switch scan (GH#801) Material findingsNone. Analysis
Non-blocking notes
Tests run (crate dir, nice, CARGO_BUILD_JOBS=3)
VERDICT: APPROVE |
3 tasks done
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.
What
columns.rs's definition-body skipping (definition_end/skip_control_or_group) scanned control-word names as ASCII letters only, so under\makeatlettera name containing@wasn't recognised as a definition target:\let\@oldtc\twocolumnstopped after the\@control symbol, leavingoldtc\twocolumnto fall through as if\twocolumnwere genuinely invoked — a one-column article incorrectly rendered two-column with no diagnostic. Same gap for the brace-less\newcommand\@x\twocolumnform.Added
is_name_char/control_word_end, and a booleanin_makeattoggle (pdflatex errors on unmatched\makeatletter/\makeatother, so nesting isn't a real concept) tracked asswitches()walks the document and threaded intodefinition_end/skip_control_or_group/skip_one_token— one fix point covers\let, the\newcommandfamily, the\deffamily and the\newenvironmentfamily.Left out of scope (follow-up)
The issue's ".sty/.cls always treat @ as a letter" part —
ColumnMode::scanis called with only the entry document's text, no file-kind signal reaches this scanner yet. The related\let-saved-switchunknown_commandnote is explicitly out of scope per the issue.Tests
at_names_in_makeatletter_definitions_do_not_switch(both issue cases plus\onecolumn/\defvariants),at_outside_makeatletter_does_not_swallow_a_switch(negative control — pdflatex itself errors there, so the existing "leak" behavior is preserved),makeatother_closes_the_at_region. Mutation check: forcing the old call sites makes the first test fail while the rest pass. Fullcargo testincrates/render-pipelineclean (independently re-run twice by the supervisor, including after a rebase onto latest main).Closes #801.
Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane columns-atname-scan, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
🤖 Generated with Claude Code