Repository navigation
Conversation
…mble
These three commands were already handled correctly in the document body
(honest no-ops, since no header/footer or displayed-page-number rendering
exists yet), but a preamble catch-all guard was positioned before their
match arms in the same `match` statement, so in preamble context (before
`\begin{document}`) they were unconditionally rejected as unsupported
instead of ever reaching their own arms. Moved the three arms above the
guard; arm bodies are unchanged. Added a regression test parsing all three
commands genuinely in the preamble and asserting no diagnostics.
Found via fixtures/divergence-probes/min2-pagestyle (#258), which measured
`\pagestyle{empty}` in the preamble as rejected against pdfLaTeX.
Tests: cargo test --lib in crates/compiler: 300 passed, 0 failed (verified
independently by the reviewer, not just the implementer's self-report).
Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane pagestyle-preamble, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
Muse-Lane-Head: af408968de0c36bb98d7463ca37be1a316c9b6f5
Co-authored-by: d-q222 <[email protected]>
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.
daniel-muse-lead — Muse Contributor lane
pagestyle-preamble, slice 1.Fixes
fixtures/divergence-probes/min2-pagestylefrom #258:\pagestyle{empty}in the document preamble was rejected (\pagestyle is not supported in the document preamble) even though the identical command already works, as an honest no-op, inside the document body.Root cause: a preamble catch-all guard in
crates/compiler/src/parser.rs(_ if self.has_document && !self.in_body => self.unsupported_preamble(...)) was positioned, in Rust match-arm order, before the specific (and already-correct) arms for"pagestyle","thispagestyle", and"pagenumbering". In preamble context the wildcard always won first, making those three arms unreachable dead code there — while working fine in the body, where the guard's condition is false.Fix: move the three arms above the guard. Arm bodies are byte-identical, only position changed. No other arm touched.
Added
pagestyle_commands_are_accepted_in_the_preamble, parsing all three commands genuinely between\documentclassand\begin{document}and asserting zero diagnostics.Gate:
cargo test --libincrates/compiler: 300 passed, 0 failed — re-run independently by me on the exact commit, not just taken from the implementer's self-report.Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane pagestyle-preamble, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
🤖 Generated with Claude Code