Expand description
Logic for parsing elements of the TeX grammar from token streams.
This parsing module is based around the Parsable trait, which is the most important type in the module. This trait is implemented by Rust types that correspond to elements of the TeX grammar. The trait implementation provides a way to parse grammar elements out of the input stream.
The module contains implementations of Parsable for tuples where each element is parsable.
This allows expressions like <integer><relation><integer> to be parsed by one invocation
of Parsable::parse, in this case on the type (i32, std::cmp::Ordering, i32).
The second most important thing is the collection of custom Rust types like OptionalEquals and FileLocation which correspond to Rust grammar elements.
Finally this module contains some functions for special situation like parsing lists of tokens.
Structs§
- Error
- File
Location - Representation of a file location in TeX
- Left
Brace - Optional
Equals - When parsed, this type consumes an optional equals from the token stream.
- Optional
Equals Unexpanded - When parsed, this type consumes an optional equals from the token stream without performing expansion.
- Optional
Space - When parsed, this type consumes an optional space from the token stream.
- Ordering
- Spaces
- When parsed, this type consumes an arbitrary number of spaces from the input stream
- Spaces
Unexpanded - When parsed, this type consumes an arbitrary number of spaces from the unexpanded input stream
- Uint
- When parsed, this type returns a nonnegative integer with the provided upper bound.
- Unexpanded
Token List
Traits§
- Parsable
- Implementations of this trait are elements of the TeX grammar than can be parsed from a stream of tokens.
Functions§
- finish_
parsing_ balanced_ tokens - Parses balanced tokens from the stream.
- parse_
keyword - Parses a keyword from the input stream.