Skip to main content

InputState

Struct InputState 

Source
pub struct InputState {
    pub stack: Vec<Level>,
    pub param_stack: Vec<TokenList>,
    pub align_state: i32,
    pub scanner_status: ScannerStatus,
    pub warning_index: CsId,
    pub open_parens: usize,
    pub force_eof: bool,
    pub last_line: i32,
    pub in_open: usize,
    pub spare_tokens: Vec<TokenList>,
}
Expand description

The input stack.

Fields§

§stack: Vec<Level>

All levels; the last one is the current input (cur_input).

§param_stack: Vec<TokenList>

Arguments of macros being expanded.

§align_state: i32

Brace balance for alignments (align_state).

§scanner_status: ScannerStatus

What the scanner is doing.

§warning_index: CsId

The macro or definition being scanned, for diagnostics.

§open_parens: usize

Number of open parentheses printed for input files.

§force_eof: bool

Whether \endinput was seen in the current file.

§last_line: i32

Line number of the most recent \read line, etc.

§in_open: usize

Text levels open on files, \scantokens pseudo-files and \read streams (TeX’s in_open).

§spare_tokens: Vec<TokenList>

One-token lists of backed-up levels that ended, for back_input to reuse (it runs very often; this saves an allocation each time).

Implementations§

Source§

impl InputState

Source

pub fn in_open(&self) -> usize

Number of text levels that are input files (TeX’s in_open).

Source

pub fn cur_text(&self) -> Option<&TextLevel>

The innermost text level, if any.

Source

pub fn line(&self) -> i32

The current line number (line): the line of the innermost file.

Source

pub fn in_token_list(&self) -> bool

Whether the current level is a token list.

Source

pub fn terminal_input(&self) -> bool

Whether we are reading from the terminal (terminal_input).

Trait Implementations§

Source§

impl Debug for InputState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputState

Source§

fn default() -> Self

Returns the “default value” for a type. 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> ErasedDestructor for T
where T: 'static,

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.