Inspect original primitives and unexpanded tokens

This commit is contained in:
gloamxun committed 2026-11-28 14:01:12 +08:00
1 parent c094d9a81d
commit 2007ac5627
7 files changed
+147 -11

No files matched your search

@@ -282,12 +282,18 @@ impl Executor {
pub(super) fn show(
&mut self,
the: bool,
command: Primitive,
span: Span,
files: &mut impl SourceProvider,
) -> Result<(), Error> {
let (mut head, mut tail) = if the {
let text = match self.the_value(files)? {
let value = match command {
Primitive::Show => None,
Primitive::Showthe => Some(self.the_value(files)?),
Primitive::Showtokens => Some(TheValue::Tokens(self.scan_group(files)?)),
_ => unreachable!("token or quantity diagnostic"),
};
let (mut head, mut tail) = if let Some(value) = value {
let text = match value {
TheValue::Text(text) => text,
TheValue::Tokens(tokens) => {
let mut text = String::new();
@@ -356,7 +362,7 @@ impl Executor {
self.events.push(Event::Show(ShowReport {
output,
log_output,
the,
the: command == Primitive::Showthe,
text,
context,
span,
@@ -883,7 +883,7 @@ impl Executor {
| Knbccode | Knaccode | Letterspacefont | Textfont | Scriptfont
| Scriptscriptfont | Endlinechar | Newlinechar | Escapechar | Globaldefs | Time
| Day | Month | Year | BeginGroup | EndGroup | Relax | Message | Errmessage
| Endinput | Showbox | Show | Showthe | Showlists | Showifs | Showgroups
| Endinput | Showbox | Show | Showthe | Showtokens | Showlists | Showifs | Showgroups
| Discretionary | DiscretionaryHyphen
| Parshape | LinePenalties(_) | Partokenname => {
return Ok(false);