Make global definitions override group shadows

A group-local \def stayed visible after a later \gdef of the same name because
scoped lookup preferred the newest scope entry, and an inline \global\def was
unsupported. Route \gdef/\xdef and \global\def/\global\let/\global\chardef
through an upsert that removes same-name entries from every live scope before
updating the global table, so the global meaning wins inside the group and
after it.

A test defines a group-local L, replaces it with G via \gdef inside the group,
and checks the group prints G and the following \a prints G; an
inline \global\def also expands.
This commit is contained in:
gloamxun committed 2026-10-27 01:49:17 +08:00
1 parent 16b61cd368
commit c3e02f0586
4 files changed
+64 -7

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 **1016 tests**:
The workspace currently passes **1017 tests**:
| Suite | Tests |
| --- | --- |
| route-D unit (engine) | 437 |
| engine binary unit | 387 |
| engine binary unit | 388 |
| server integration | 63 |
| v1 integration | 71 |
| pdfLaTeX oracle | 42 |