Skip to main content

Module control_sequences

Module control_sequences 

Source
Expand description

A control sequence is a Token of the (usually) form \foo. We can just use strings to represent them, but there is room for optimization by e.g. interning them, which requires some more infrastructure to intern and resolve them.

We implement the trait CSHandler for the Unit type (), in case we don’t want to do any interning and just use Ptr<str>s.

Structs§

CSInterner
A CSHandler that interns control sequence names as u32.
CSNameVec
A CSNameMap that uses a Vec to store the values for InternedCSName. Since the InternedCSNames are consecutive, we can use a Vec instead of a HMap.
DisplayCSName
Utility struct for displaying a control sequence name.

Traits§

CSHandler
Handles control sequence names - conversion from/to strings, displaying etc.
CSName
The name of a control sequence.
CSNameMap
How to map control sequence names to e.g. Commands.
ResolvedCSName
A control sequence name that has been interned needs to be resolved again to get the actual name / display it etc.

Type Aliases§

InternedCSName
A control sequence name that has been interned. Uses consecutive u32 values