Type Alias SpliceSpan
pub type SpliceSpan = Option<Box<SpliceSpanPayload>>;Expand description
The reduce-time container span a NodeValue::Splice carries up to the
parent that drains it: a (start, end) pair of (line, column, pos)
triples. Lark keeps the spliced _-rule as a Tree(_rule) and its parent
reads that Tree’s container_* meta; our
flat Splice carries the same span here instead. None when the _-rule
has no positioned raw child (an Empty _rule meta — the parent skips it).
Meaningful only mid-reduce: it is None in propagate_positions=off
(zero-cost) and irrelevant once a Splice is drained.
Boxed so it costs one pointer, not 28 bytes, in the NodeValue enum:
Splice is the widest variant, so an inline span set size_of::<NodeValue>()
to 56; boxing shrinks it to 32 (the value stack + arena are the hottest parse
structures, so their per-node width is load-bearing — measured calc parse-basic
−0.018 ms). The Box is allocated
only when a positioned or poisoned _-rule reduces in propagate_positions=on
mode; off-mode keeps None and never allocates.
Aliased Type§
pub enum SpliceSpan {
None,
Some(Box<SpliceSpanPayload>),
}