pub struct Parameter {Show 18 fields
pub novalue: bool,
pub testopt: bool,
pub testopt_call: Option<Rc<TestoptCall>>,
pub after_box: bool,
pub semiverbatim: Option<Vec<char>>,
pub optional: bool,
pub name: SymStr,
pub spec: SymStr,
pub extra: Vec<Tokens>,
pub inner: Option<Parameters>,
pub reader: ReaderClosure,
pub predigest: Option<ReaderPredigestClosure>,
pub reversion: Option<ReversionClosure>,
pub digested_reversion: Option<DigestedReversionClosure>,
pub before_digest: Vec<BeforeDigestClosure>,
pub after_digest: Vec<DigestionClosure>,
pub name_kind: Cell<Option<(bool, bool)>>,
pub stated: RefCell<Option<Tokens>>,
}Fields§
§novalue: bool§testopt: boolA \newcommand-family optional argument: latex.ltx reads it through
\@protected@testopt → \@testopt → \kernel@ifnextchar[ (1249, 1261,
1259-1260), a futurelet peek, so its macro
peeks_by_futurelet.
testopt_call: Option<Rc<TestoptCall>>The \@protected@testopt call its command is in LaTeX, where the command’s definer made the internal it names
(TestoptCall).
after_box: boolA size argument latex.ltx evaluates with the box already set, so that
\width/\height/\depth/\totalheight measure it (\@begin@tempboxa,
latex.ltx:16085-16094): TempboxaDimension, graphics’ GraphixDimension. See
Parameters::read_arguments_and_digest.
semiverbatim: Option<Vec<char>>§optional: bool§name: SymStr§spec: SymStr§extra: Vec<Tokens>§inner: Option<Parameters>§reader: ReaderClosure§predigest: Option<ReaderPredigestClosure>§reversion: Option<ReversionClosure>§digested_reversion: Option<DigestedReversionClosure>Reversion closure that operates on the original Digested argument.
Takes precedence over reversion when the argument is a digested value.
Perl equivalent: reversion option on DefParameterType with undigested => 1.
before_digest: Vec<BeforeDigestClosure>§after_digest: Vec<DigestionClosure>§name_kind: Cell<Option<(bool, bool)>>(OptionalMatch…, Until…) of name, worked out on the first read (lazily: name is set
by struct update after Default), so a read pays no interner lookup.
stated: RefCell<Option<Tokens>>A braced or bracketed argument’s tokens as the source states them ({0.48\textwidth}), kept for the reader that
asked for them (Parameters::read_arguments_and_digest under KEEP_STATED_LENGTHS): Some while asked
for, holding them once Parameters::reparse_argument has read them.
Implementations§
Source§impl Parameter
impl Parameter
pub fn new<T: AsRef<str>>( name: T, spec: T, extra: Option<Vec<Tokens>>, ) -> Result<Self>
pub fn init(self) -> Result<Self>
Sourcepub fn check_reader_function(name: &str) -> Option<ReaderClosure>
pub fn check_reader_function(name: &str) -> Option<ReaderClosure>
Obtain the reader of a given parameter name, if available
pub fn setup_catcodes(&self)
pub fn revert_catcodes(&self) -> Result<()>
pub fn read(&self, fordefn: Option<&dyn Definition>) -> Result<ArgWrap>
pub fn digest( &self, value_arg: ArgWrap, _fordefn: Option<&Constructor>, ) -> Result<Option<Digested>>
pub fn revert(&self, value_opt: Option<Tokens>) -> Result<Option<Tokens>>
Trait Implementations§
Source§impl Object for Parameter
impl Object for Parameter
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().Source§fn get_origin(&self) -> DefinitionOrigin
fn get_origin(&self) -> DefinitionOrigin
definition::origin). The
default is Unknown, which counts as LaTeXML’s own.Source§impl ToTokens for Parameter
Available on crate feature codegen only.
impl ToTokens for Parameter
codegen only.