Skip to main content

Module mouth

Module mouth 

Source
Expand description

A Mouth provides a stream of Tokens to be processed by an engine; either by tokenizing a file or by returning the Tokens expanded by a macro

Modules§

strings

Structs§

DefaultMouth
The default implementation of Mouth. Well optimized to be fast, but at the cost of not keeping track of “the depth of current macro expansions” - I found that to be an acceptable loss, since afaict, the only thing that is done with that information is to print a corresponding number of .s if \tracingcommands is set. By omitting that and just concatenating all expansions into a single Vec from which to pop(), we gain a massive speedup.

Traits§

Mouth
A Mouth provides a stream of Tokens to be processed by an engine; either by tokenizing a file or by returning the Tokens expanded by a macro. Since a TeX engine spends most of its time processing and expanding Tokens, the Mouth is likely the most performance critical component of the engine.