Consume catcode assignments for every character
Only \catcode`\@ assignments were handled; a class file setting the catcode of # or _ left the assignment in the text. The canonicalisation pass now consumes any successfully parsed \catcode assignment (backtick, bare or code-point target), applying the value only to @ (11/12); other targets are recorded by their consumption but do not change scanning yet, since the scanner still has a single modelled catcode. A preview test sets # and _ to 12, then renders "#hash and a_b." with no warnings and no leaked assignment.
This commit is contained in:
1 parent
b16e5a53e8
commit
54a0926552
3 files changed
+34
-8
No files matched your search
+6
-5
@@ -370,7 +370,7 @@ Math coverage includes fractions/roots, scripts, `\left...\right` with body-scal
|
||||
|
||||
Paragraph units carry a `ParagraphFont`; `Unit::paragraph_with_face` and `Unit::paragraph_with_style_and_face` select Roman, bold, italic, mono, or sans. The corresponding Computer Modern TFM (`cmr10`, `cmbx10`, `cmti10`, `cmbxti10`, `cmtt10`, `cmss10`, `cmssbx10`, `cmssi10`, `cmcsc10`) supplies advances, kerns, ligatures, and italic correction for layout, the display list selects the matching face, and the PDF writes Computer Modern Type1 outlines for each built-in face (`cmr10`/`cmbx10`/`cmti10`/`cmbxti10`/`cmtt10`/`cmss10`/`cmssbx10`/`cmssi10`/`cmcsc10`, plus `cmmi10` for mathematical italic letters, `cmsy10` for math symbols and `cmex10` for big operators), falling back to Liberation subsets only for characters the Type1 encodings cannot address; those fallback glyphs keep their Unicode text under PDF extraction, so accented and Greek words round-trip; Type1 faces carry a ToUnicode CMap built from the requested characters, so glyphs whose names are ambiguous in the Adobe Glyph List (capital Omega, which would otherwise extract as U+2126) keep their intended code points. `Engine::edit` preserves the face when reflowing an edited paragraph.
|
||||
|
||||
The crate currently has 437 unit tests plus ten route-D integration tests and forty-two oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 1001 tests (437 route-D unit, 374 engine binary unit, 10 route-D integration, 42 oracle, 71 v1 integration, 62 server, 4 engine unit, 1 core unit), with none ignored. The flat `/preview` endpoint and the project preview/PDF endpoints now try route-D first and fall back to v1 on error (`?engine=v1` or `TEXRRA_ENGINE=v1` forces v1; the flat response carries `X-Preview-Engine`, naming the engine used). A geometry-less project now defaults to Letter, matching pdfLaTeX, where the old v1 path used A4.
|
||||
The crate currently has 437 unit tests plus ten route-D integration tests and forty-two oracle fixtures. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 1002 tests (437 route-D unit, 375 engine binary unit, 10 route-D integration, 42 oracle, 71 v1 integration, 62 server, 4 engine unit, 1 core unit), with none ignored. The flat `/preview` endpoint and the project preview/PDF endpoints now try route-D first and fall back to v1 on error (`?engine=v1` or `TEXRRA_ENGINE=v1` forces v1; the flat response carries `X-Preview-Engine`, naming the engine used). A geometry-less project now defaults to Letter, matching pdfLaTeX, where the old v1 path used A4.
|
||||
|
||||
### M0 incremental demo
|
||||
|
||||
@@ -544,10 +544,11 @@ are:
|
||||
the body expand their bodies (including `\csname`) when read, while a plain
|
||||
`\def` stays lazy. A runtime `\def` also parses its parameter text, so a
|
||||
body-embedded `\def\foo#1{...}` (undelimited or delimited) expands with its
|
||||
arguments instead of leaking. A `\catcode` assignment is recognised for `@`
|
||||
(backtick, bare or code-point target, values 11/12), so class files that set
|
||||
the catcode directly instead of using `\makeatletter` work; catcodes for any
|
||||
other character are still unmodelled, and there is no token stream. A runtime
|
||||
arguments instead of leaking. A `\catcode` assignment is consumed for any
|
||||
target (backtick, bare or code-point form); only `@` (values 11/12) changes
|
||||
scanning, so class files that set it directly instead of using
|
||||
`\makeatletter` work, while other catcode values are recorded but not applied
|
||||
yet. There is no token stream. A runtime
|
||||
`\csname ... \endcsname` (also inside ordinary macro bodies) expands its
|
||||
contents and resolves the named macro, yielding nothing when undefined.
|
||||
`\futurelet\alias\command <token>` binds the looked-ahead token to the
|
||||
|
||||
Reference in new issue
Block a user