pub struct Signatures<'a> { /* private fields */ }Expand description
A two-tier signature lookup: a per-document SignatureDb of scanned
\newcommand/\newenvironment/xparse definitions consulted first, falling back
to the process-wide builtin DB. Cheap to copy (it borrows the scanned DB),
so it threads through the formatter’s lowering like a context handle.
Scanned-first matches TeX scoping intuition: a locally (re)defined command shadows a built-in of the same name. (We do not yet model where a definition becomes visible — a whole-file union — which is sound for the formatter’s arity needs; lexical/conditional visibility is out of scope, per AGENTS.md #1.)
Implementations§
Source§impl<'a> Signatures<'a>
impl<'a> Signatures<'a>
Sourcepub fn new(user: &'a SignatureDb) -> Self
pub fn new(user: &'a SignatureDb) -> Self
Resolve against user first, then the built-in DB.
Sourcepub fn command(&self, name: &str) -> Option<&'a CommandSig>
pub fn command(&self, name: &str) -> Option<&'a CommandSig>
The signature of command name: scanned definition first, then the curated
built-in, then the bulk CWL tier. CWL is consulted last and contributes only
argument arity (its behavior flags are all default), so a CWL-only command is
laid out like any unknown command, just with its argument count known.
Sourcepub fn environment(&self, name: &str) -> Option<&'a EnvironmentSig>
pub fn environment(&self, name: &str) -> Option<&'a EnvironmentSig>
The signature of environment name: scanned, then built-in, then CWL. See
command for why the CWL tier is safe to consult here.
Trait Implementations§
Source§impl<'a> Clone for Signatures<'a>
impl<'a> Clone for Signatures<'a>
Source§fn clone(&self) -> Signatures<'a>
fn clone(&self) -> Signatures<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more