pub struct Begin { /* private fields */ }Expand description
A \begin{name} node.
Implementations§
Source§impl Begin
impl Begin
Sourcepub fn name_group(&self) -> Option<NameGroup>
pub fn name_group(&self) -> Option<NameGroup>
The {name} group following \begin.
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
The environment name (braces dropped), or None for a malformed \begin.
A BEGIN opened by an environment alias (\bea, issue #109) carries no
NAME_GROUP at all — the whole node is the bare control word — so the name
falls back to that word with its \ stripped. Positional and meaning-free,
per decision #10: it reads the name from wherever the tree puts it and looks
nothing up. Signatures::environment is what maps bea on to the target’s
curated behavior.
The fallback is guarded on the head not being \begin, so the malformed
\begin-without-a-name path (which builds a BEGIN with no NAME_GROUP)
keeps reporting None rather than suddenly claiming to be named begin.
Sourcepub fn is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Whether this BEGIN is an environment-alias delimiter — a bare control
word standing in for \begin{X} — rather than a spelled-out \begin{X}.
Purely structural (no NAME_GROUP, head is not \begin), like every other
accessor here. It exists because name makes the two shapes
indistinguishable by name, and the alias table describes the command, not
the name: a literal \begin{bea} written in a file that also defines \bea
as an alias is a different, unrelated environment and must not inherit the
target’s behavior. Signatures::environment_at is the consumer.
Sourcepub fn name_range(&self) -> Option<TextRange>
pub fn name_range(&self) -> Option<TextRange>
The byte range of the environment name inside the NAME_GROUP.