Skip to main content

StomachMark

Struct StomachMark 

Source
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

Source

pub fn take() -> StomachMark

The stack of tokens being invoked and the active conditionals as they are now.

Source

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.

Trait Implementations§

Source§

impl Drop for StomachMark

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.