Repository navigation
compiler: general factor-by-length dimensions and register readback (#835) - #863
Conversation
… args (#835) Route \hspace/\hspace*/\vspace through flashtexhspace/flashtexvspace shims that absorb the star and {<dimen>} with one expansion pass and splice [<factor>]<register> to its fixed-point value text, so a \newlength register never reaches the stomach as an assignment ("Missing number" + "Illegal unit" + parser "got ''"). Anything else passes through verbatim; the shim never reports. Implementation-Agent: muse-spark-1.3-contributor Commit-Executor: muse-spark-1.3-contributor
… llap vocab (#835) Bug 1: parse_dimen_pt_with_units accepts <factor><length> for every real TeX/LaTeX length name (FACTOR_LENGTHS), not just preamble lengths; hspace/vspace read dimen_source so the backslash survives; enlargethispage tries baselineskip_multiple first so its real leading is not shadowed by the new zero-acceptance. Unowned values stay 0.0 (the preamble-length convention); bare factors and undeclared registers still error. Bug 2 (compiler side): prelude routes hspace/vspace through the new engine shims; done-markers map back in the converter. Bug 3: llap/rlap join KNOWN_UNIMPLEMENTED_COMMANDS, killing the misleading 'did you mean \\flat?' (no implementation yet). Implementation-Agent: muse-spark-1.3-contributor Commit-Executor: muse-spark-1.3-contributor
#845's `fn is_list_length` landed adjacent to this branch's `FACTOR_LENGTHS` plus `fn is_length_name`. Same shape as the conflict in #860: this branch's side ends mid-function body and is closed by the `}` that follows the conflict block, so concatenating both sides yields an unclosed delimiter. Closed is_length_name explicitly and let is_list_length take the trailing brace. Verified: cargo check 0 errors; is_length_name, is_list_length and is_length_reference each present exactly once; no conflict markers. Commit-Executor: daniel-parent Co-authored-by: Claude Opus 5 <[email protected]>
|
CI failure diagnosed and reproduced locally: a debug/release divergence. The failureDeterministic — 3 for 3 in release, 0 for 3 in debug. What the span points atSo in release the This is the core feature of this PR — a coefficient times a length register — failing in the build configuration users actually ship. It is not a flaky test or an environment artifact. Likely direction, not yet confirmedThe Required before this can merge
Laning the fix. |
… heads Two integration fixes for the merges just above, each pinned by a test. #863 (factor-by-length dimensions) made `parse_dimen_pt_current` accept `<factor>\baselineskip` as an unvalued `FACTOR_LENGTHS` reference, which shadowed main's own `baselineskip_multiple` fallback for list lengths (8a24707): `\setlength{\topsep}{0.6\baselineskip}` inside a list warned "unsupported length expression" instead of resolving 7.2pt (`list_topsep_accepts_a_baselineskip_factor`). The leading multiple is now tried first, in `apply_length_value` and in `calc_chain_term_pt_current` — the same reorder #863 itself applied to `\enlargethispage`. #950 (environment bodies as real groups) emits the environment's `\begingroup` brace directly ahead of every reconstituted `\begin{name}`, so beamer's optional `{title}{subtitle}` scan after `\begin{frame}` read a nested `\begin{itemize}`/`\begin{columns}` as a title group and reported "argument to \frame is missing its closing brace" (5 failures in `beamer_blocks`/`beamer_overlays`). `environment_group_open_at` tells that brace apart (a literal `{` ahead of an environment is followed by the environment's own brace, never by `\begin` itself), and the four `\@ifnextchar\bgroup`-style scans — frame head, `\onslide`, `\note`, the theme declarations — use `next_opens_literal_group`. Real `\column{...}` / `\frame{...}` argument parsing is untouched (their braces are literal). Implementation-Agent: Claude Code (mac-claude-a / lane-integrate2) Commit-Executor: git via Claude Code Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
…he integration batch + package definitions The pin reads main again after the second integration pass (#827 cherry-picks, #863, #950, #737/#739/#758/#732/#740/#825, visual-oracle tooling) and the `metadata.packages` work (`crate::package_definitions`, tex-expansion's `package_defs.rs`). `git archive` of this tree's `crates/compiler` and `crates/tex-expansion`, PINs at the merge commit, VENDORING.md rows updated, `scripts/check-vendor-pins.sh` both "up to date". render-pipeline 819/0 in both profiles against the new pins; compiler 1368/0, tex-expansion 150/0 release; Mac inventory sync current; swift build clean. Implementation-Agent: Claude Code (mac-claude-a) Commit-Executor: git via Claude Code Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
Fixes the reusable parts of #835, found in a real user's custom
questionenvironment.Three defects
1. A coefficient times a length register was rejected.
\setlength{\topsep}{0.6\baselineskip}errored. TeX allows<factor><length>anywhere a dimension is expected.parse_dimen_pt_with_unitsnow accepts it for every real TeX/LaTeX length name — a newFACTOR_LENGTHScovering TeX dimen/skip params, list lengths and\z@/\z@skip— not just the preamble lengths an earlier PR special-cased.2.
\newlengthregisters did not read back as dimensions.\newlength{\qnumsep}\setlength{\qnumsep}{1em}\hspace{\qnumsep}gavegot ''. NewFlashtexHspace/FlashtexVspaceprimitives absorb the star and{<dimen>}in one expansion pass and splice exactly-[<factor>]<register>to fixed-point text. A bare skip splices full\the-style glue so\vspacekeeps its stretch; anything else passes through unchanged.3.
\llap's diagnostic suggested "did you mean\flat?" — actively misleading.llap/rlapnow joinKNOWN_UNIMPLEMENTED_COMMANDS, giving an honest "not supported" with no bogus suggestion.\llapitself is still not implemented; this fixes the advice, not the feature.\clap(mathtools-only) untouched.Oracle-verified values
Live pdflatex (pdfTeX 1.40.29, TeX Live 2026), 11pt
article, 1 page each, pages viapdfinfo:0.6\baselineskip\parindent2\parindent= 34.0pt; at 10pt: 15.0/12.0 leading)\qnumsep(0.6em)2\zerolen-.5\textwidthNegative factors, bare factors, zero-valued registers and undeclared registers (which must still error, naming the register) are all covered.
Tests
cargo test -p flashtex-compiler: exit 0, 87 binaries ok, 1,064 passed, 0 failed. Newregister_space_lengths(7 tests) andllap_and_rlap_are_known_unimplemented_not_flat_typos.Housekeeping
Merged
origin/main(f189d339); the publish gate had refused the raw branch because it would have deleted the KOMAclass-geometrywork. Re-ranapps/mac/scripts/sync-supported-latex.sh, since the lane changed the vocabulary but cannot touchapps/**.crates/compilerandcrates/tex-expansion, so the compiler half does not reach users untilvendor/compileris re-pinned.Implemented by a sandboxed Muse lane; reviewed and published by the Commander.
🤖 Generated with Claude Code