Resolve csname targets with arguments

\csname foo\endcsname stopped after looking up a zero-argument macro; a
parameterised target was left unresolved. After the zero-argument fast path,
build a synthetic command from the resolved name plus the text following
\endcsname and run the normal macro lookup, so arguments/defaults/delimited
parameter text are consumed exactly as for a literal \foo, and only the bytes
belonging to the csname construct are charged to the caller.

A test defines \foo#1{[#1]} and prints both \csname foo\endcsname{x} and
\csname foo\endcsname{y} as "[x] and [y]" with no warnings.
This commit is contained in:
gloamxun committed 2026-10-27 01:51:29 +08:00
1 parent c3e02f0586
commit c3ae52452d
4 files changed
+41 -11

No files matched your search

+2 -2
View File
@@ -14,12 +14,12 @@ cargo fmt --all -- --check
cargo test --workspace --offline
```
The workspace currently passes **1017 tests**:
The workspace currently passes **1018 tests**:
| Suite | Tests |
| --- | --- |
| route-D unit (engine) | 437 |
| engine binary unit | 388 |
| engine binary unit | 389 |
| server integration | 63 |
| v1 integration | 71 |
| pdfLaTeX oracle | 42 |