#[repr(u16)]pub enum Catcode {
Show 19 variants
ESCAPE = 0,
BEGIN = 1,
END = 2,
MATH = 3,
ALIGN = 4,
EOL = 5,
PARAM = 6,
SUPER = 7,
SUB = 8,
IGNORE = 9,
SPACE = 10,
LETTER = 11,
OTHER = 12,
ACTIVE = 13,
COMMENT = 14,
INVALID = 15,
CS = 16,
MARKER = 17,
ARG = 18,
}Expand description
A Token category code, as in TeX
Two bytes (#[repr(u16)]), so that Token (text u32, code, prov u16) has no padding byte: with one, every
move of a token on the gullet’s read path (Option<Token>, CheckedRead::Tok, the Result slot) copied the pad
and prov as a 3-byte blob, byte by byte (token_layout_code_at_byte_4).
Variants§
ESCAPE = 0
BEGIN = 1
END = 2
MATH = 3
ALIGN = 4
EOL = 5
PARAM = 6
SUPER = 7
SUB = 8
IGNORE = 9
SPACE = 10
LETTER = 11
OTHER = 12
ACTIVE = 13
COMMENT = 14
INVALID = 15
CS = 16
MARKER = 17
ARG = 18
Implementations§
Source§impl Catcode
impl Catcode
Sourcepub fn name_sym(self) -> SymStr
pub fn name_sym(self) -> SymStr
SymStr form of name() — each variant caches its interned
symbol via pin!. Used by Token::get_cs_name /
pin_cs_name to avoid a per-call pin_static hash probe
(fires on every primitive-token definition lookup).
Sourcepub fn short_name(self) -> &'static str
pub fn short_name(self) -> &'static str
a short name helpful for Token debugging
Sourcepub fn is_primitive(self) -> bool
pub fn is_primitive(self) -> bool
TeX-primitive codes
Sourcepub fn is_executable(self) -> bool
pub fn is_executable(self) -> bool
Catcodes with associated primitives
Sourcepub fn is_neutralizable(self) -> bool
pub fn is_neutralizable(self) -> bool
Catcodes which can be neutralized
Sourcepub fn is_active_or_cs(self) -> bool
pub fn is_active_or_cs(self) -> bool
Shorthand to match the “active” and “command sequence” catcodes
Sourcepub fn is_absorbable(self) -> bool
pub fn is_absorbable(self) -> bool
Tokens which can be absorbed without side-effects
Sourcepub fn is_gullet_holdable(self) -> bool
pub fn is_gullet_holdable(self) -> bool
Gullet can only hold comment and marker tokens
Sourcepub fn is_balanced_interesting(self) -> bool
pub fn is_balanced_interesting(self) -> bool
Catcodes that are of note for balanced reads.
Trait Implementations§
impl Copy for Catcode
impl Eq for Catcode
impl StructuralPartialEq for Catcode
Source§impl ToTokens for Catcode
Available on crate feature codegen only.
impl ToTokens for Catcode
codegen only.