pub struct StomachMark { /* private fields */ }Expand description
What a speculative digestion — one whose output is discarded and whose assignments its journal undoes (the
frontmatter’s title-page runs, rehearsals and label reads) — must leave as it found it besides its assignments: the
stack of tokens being invoked and the active conditionals. Taken before the run, put back however it ends
(StomachMark::restore): the document never runs the run’s tokens. A runaway Fatal the run raised and discarded
(a Stomach:Recursion) left the whole MAXSTACK of tokens on the stack, and the document’s next digestion failed
its first push with a ghost Fatal of its own (2502.10606’s \thanks inside a \thanks, all 8,054 words lost, as
clear_token_stack’s 2410.07647); a \fi of the run’s closing a conditional the document opened before it left
that conditional closed for the document, whose own \fi then had none (2003.03814: CUP-JNL-DCE.cls:505 \keywords
leaves its \ifx open, \fi inside \@keywords, which \printkeywords balances; the title-page run’s
\printkeywords closed it and the class’s real \maketitle raised “Didn’t expect a \fi”). Runs that read one text
in pieces share its conditionals as TeX reads it, in one pass: the observer rehearses an author list block by block,
a conditional opened in one block’s run closed in the next’s (2606.17718’s \IEEEauthorblockA{… \if… E-mail: …} \else … \fi), so its shadow takes the mark around the whole sequence and each rehearsal puts back only its token
stack (truncate_token_stack).
Put back on drop too, so every exit restores — a ? that propagates a run’s Fatal included (review rev135c S1) —,
except while a panic unwinds (the state may be borrowed).
Implementations§
Source§impl StomachMark
impl StomachMark
Sourcepub fn take() -> StomachMark
pub fn take() -> StomachMark
The stack of tokens being invoked and the active conditionals as they are now.
Sourcepub fn restore(self)
pub fn restore(self)
Put both back as StomachMark::take found them: the tokens a failed invocation left on the stack dropped, the
conditionals the run opened dropped and those it closed open again.