pub struct Register {Show 13 fields
pub cs: Token,
pub address: String,
pub parameters: Option<Parameters>,
pub register_type: RegisterType,
pub readonly: bool,
pub value: Option<RegisterValue>,
pub getter: Option<RegisterGetterClosure>,
pub setter: Option<RegisterSetterClosure>,
pub default: Option<RegisterValue>,
pub mathglyph: Option<char>,
pub role: Option<SymStr>,
pub chardef_props: SymHashMap<Stored>,
pub locator: Locator,
}Expand description
A struct representing a TeX register
Fields§
§cs: Tokenthe public command sequence for this register
address: Stringthe internal address for this register
parameters: Option<Parameters>associated parameters, if any
register_type: RegisterTypethe type of values accepted by this register (Number, Dimension, …)
readonly: boolread-only flag (default: false)
value: Option<RegisterValue>the current value
getter: Option<RegisterGetterClosure>reader for a value
setter: Option<RegisterSetterClosure>setter for a value
default: Option<RegisterValue>a default value
mathglyph: Option<char>the unicode corresponding to the \mathchar of value (for chardef)
role: Option<SymStr>role attribute for math chardef (e.g. “MULOP”, “BINOP”)
chardef_props: SymHashMap<Stored>additional properties for math chardefs (meaning, stretchy, scriptpos, mathstyle, etc.)
locator: Locatorthe source point of origin for this register definition
Implementations§
Source§impl Register
impl Register
Sourcepub fn is_readonly(&self) -> bool
pub fn is_readonly(&self) -> bool
checks the readonly flag
Sourcepub fn new_chardef(
cs: Token,
value: Option<RegisterValue>,
mathglyph: Option<char>,
role: Option<SymStr>,
) -> Self
pub fn new_chardef( cs: Token, value: Option<RegisterValue>, mathglyph: Option<char>, role: Option<SymStr>, ) -> Self
A CharDef is a specialized register;
You can’t assign it; when you invoke the control sequence, it returns
the result of evaluating the character (more like a regular primitive).
When mathglyph is provided, it is the unicode corresponding to the \mathchar of value
Sourcepub fn new_math_chardef(
cs: Token,
value: Option<RegisterValue>,
mathglyph: Option<char>,
role: Option<SymStr>,
props: CharDefProps,
) -> Self
pub fn new_math_chardef( cs: Token, value: Option<RegisterValue>, mathglyph: Option<char>, role: Option<SymStr>, props: CharDefProps, ) -> Self
A math CharDef is like a regular CharDef but stores additional decoded math properties (meaning, stretchy, scriptpos, mathstyle, chardef_name, etc.) Perl: LaTeXML::Core::Definition::CharDef->new($cs, ‘math’, $value)
pub fn get_address(&self) -> Cow<'_, str>
Trait Implementations§
Source§impl Definition for Register
impl Definition for Register
fn is_register(&self) -> bool
fn is_prefix(&self) -> bool
fn is_readonly(&self) -> bool
fn invoke(&self, _once_only: bool) -> Result<Tokens>
fn get_parameters(&self) -> Option<&Parameters>
Source§fn get_cs(&self) -> Cow<'_, Token>
fn get_cs(&self) -> Cow<'_, Token>
fn get_cs_name(&self) -> Cow<'_, str>
fn get_alias(&self) -> Option<&String>
Source§fn set_value(
&self,
value: RegisterValue,
scope: Option<Scope>,
args: Vec<ArgWrap>,
)
fn set_value( &self, value: RegisterValue, scope: Option<Scope>, args: Vec<ArgWrap>, )
fn invoke_primitive(&self) -> Result<Vec<Digested>>
fn before_digest(&self) -> Option<&Vec<BeforeDigestClosure>>
fn after_digest(&self) -> Option<&Vec<DigestionClosure>>
fn read_arguments(&self) -> Result<Vec<ArgWrap>>
fn do_absorption( &self, _document: &mut Document, _whatsit: &Whatsit, ) -> Result<Vec<Node>>
fn value_of(&self, args: Vec<ArgWrap>) -> Option<RegisterValue>
fn register_type(&self) -> Option<RegisterType>
fn get_cs_or_alias(&self) -> Cow<'_, Token>
fn get_sizer(&self) -> Option<SizingClosure>
fn is_protected(&self) -> bool
fn get_test(&self) -> Option<&ConditionalClosure>
fn get_conditional_type(&self) -> Option<ConditionalType>
fn invocation( &mut self, args: Vec<Option<Tokens>>, _gullet: &mut Gullet, ) -> Result<Tokens>
fn get_num_args(&self) -> usize
fn after_digest_body(&self) -> Option<&Vec<DigestionClosure>>
fn capture_body(&self) -> bool
fn execute_before_digest(&self) -> Result<Vec<Digested>>
fn execute_after_digest(&self, whatsit: &mut Whatsit) -> Result<Vec<Digested>>
fn execute_after_digest_body( &self, whatsit: &mut Whatsit, ) -> Result<Vec<Digested>>
fn get_reversion_spec(&self) -> Option<Reversion>
fn get_expansion(&self) -> Option<&ExpansionBody>
fn stringify_type(&self, deftype: &str) -> String
Source§impl Object for Register
impl Object for Register
fn stringify(&self) -> String
fn isa_box(&self) -> bool
fn is_expandable(&self) -> bool
fn is_definition(&self) -> bool
fn is_comment(&self) -> bool
fn be_digested(self) -> Result<Digested>
Source§fn get_locator(&self) -> Option<Locator>
fn get_locator(&self) -> Option<Locator>
None is the honest
“no recorded source position” (replacing the old Locator::default()
file!()/line!() sentinel). For “where the parser is now” (error
reporting, box creation), use the free fn gullet::get_locator().