Invoke frozen original primitives in native TeX
This commit is contained in:
1 parent
2007ac5627
commit
ba548ef05d
10 files changed
+219
-33
No files matched your search
@@ -131,3 +131,39 @@ fn primitive_inspection_requires_the_original_name_and_live_meaning() {
|
||||
assert!(result.reads.contains(&Dependency::Meaning(CommandName::Control("hbox".into()))));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn primitive_execution_preserves_the_deferred_prefix_across_expanded_definitions() {
|
||||
for (profile, spelling) in [
|
||||
(InputProfile::TeX8Bit, r"\pdfprimitive"),
|
||||
(InputProfile::XeTeX, r"\primitive"),
|
||||
] {
|
||||
let source = r"\catcode123=1 \catcode125=2
|
||||
\let\p=PREFIX \let\outerbox=\hbox
|
||||
\count0=37
|
||||
\def\count{\errmessage{live count}}
|
||||
\def\iftrue{\errmessage{live iftrue}}
|
||||
\edef\saved{\p\hbox{\p\iftrue\vrule width9pt height1pt\else\errmessage{branch}\fi}}
|
||||
\def\hbox{\errmessage{live hbox}}
|
||||
\setbox0=\outerbox{\saved}
|
||||
\message{VALUES:\number\p\count0/\the\wd0}
|
||||
\p\unregistered
|
||||
\end"
|
||||
.replace("PREFIX", spelling);
|
||||
let result = Executor::new(
|
||||
State::initex().with_etex().with_input_profile(profile),
|
||||
Limits::default(),
|
||||
)
|
||||
.run(
|
||||
SourceFile {
|
||||
name: "primitive.tex".into(),
|
||||
data: source.into_bytes(),
|
||||
},
|
||||
&mut NoFiles,
|
||||
)
|
||||
.unwrap();
|
||||
assert!(result.events.iter().any(|event| matches!(
|
||||
event, Event::Message { text, .. } if text == "VALUES:37/9.0pt"
|
||||
)));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user