pub enum Command<S> {
Expansion(ExpansionFn<S>, Option<Tag>),
Macro(Rc<Macro>),
Execution(ExecutionFn<S>, Option<Tag>),
Variable(Rc<Command<S>>),
CharacterTokenAlias(Value),
Character(char),
MathCharacter(MathCode),
}
Expand description
A TeX command.
Variants§
Expansion(ExpansionFn<S>, Option<Tag>)
An expansion primitive that is implemented in the engine.
Examples: \the
, \ifnum
.
Macro(Rc<Macro>)
A user defined macro.
Examples: \newcommand
and \include
in LaTeX.
Execution(ExecutionFn<S>, Option<Tag>)
A non-expansion primitive that performs operations on the state.
Examples: \def
, \par
.
Variable(Rc<Command<S>>)
A command that is used to reference a variable, like a parameter or a register.
Such a command is resolved to get the variable using the function pointer it holds.
Examples: \count
, \year
.
CharacterTokenAlias(Value)
A command that aliases a character token.
Depending on the context in which this command appears it may behave like a
character (when typesetting) or like an unexpandable command (when parsing integers).
Created using \let\cmd=<character>
.
Character(char)
A command that references a character.
These commands are generally created using \countdef
.
In the main inner loop they result in a character being typeset.
In other contexts they are interpreted as numbers.
In Plain TeX, \countdef 255
is used as a more efficient version of \def{255 }
.
MathCharacter(MathCode)
A command that references a math character.
These commands are generally created using \mathchardef
.