pub struct EnvironmentDecl {
pub like: Option<SmolStr>,
pub begin: Vec<CommandName>,
pub end: Vec<CommandName>,
}Expand description
One [environments.<name>] entry: what the environment named by the key
behaves like, and which command spellings stand in for its delimiters.
The key is the environment’s own name, whether or not it is one the
built-in database knows. That is what lets a single entry serve both shapes
the issue asked for — \begin{myenv} … \end{myenv} needing only behavior,
and \startmyenv … \endmyenv needing behavior and spellings — without a
union-typed entry.
Fields§
§like: Option<SmolStr>The curated built-in environment whose behavior this one copies — math, alignment, list-ness, verbatim-ness, and every flag added later.
Resolved against the built-in database alone, never the CWL tier or
scanned definitions, for the same reason the alias arm of
Signatures::environment_at is: a declaration supplies a spelling, and
behavior always comes from curated data. An unknown target is an error
rather than a silent no-op, because a mistyped like = "algin" is
otherwise invisible.
begin: Vec<CommandName>Command spellings that stand in for this environment’s \begin{…}
(\bea, \startmyenv). Any of them opens the environment; the closers
in end close it — and so does the literal \end{…}, which
is why either list may stand alone (issue #117).
end: Vec<CommandName>Command spellings that stand in for this environment’s \end{…}. Kept a
separate list rather than begin/end tuples because pairing is by kind,
not by index: \bea … \eea pairs whichever spellings the author used.
Implementations§
Source§impl EnvironmentDecl
impl EnvironmentDecl
Sourcepub fn has_delimiters(&self) -> bool
pub fn has_delimiters(&self) -> bool
Whether this entry declares delimiter spellings (as opposed to behavior alone).
Trait Implementations§
Source§impl Clone for EnvironmentDecl
impl Clone for EnvironmentDecl
Source§fn clone(&self) -> EnvironmentDecl
fn clone(&self) -> EnvironmentDecl
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more