pub struct Expl3Unit {
pub last: usize,
pub branches: Vec<TextRange>,
}Expand description
The resolved shape of one expl3 call unit — what [consume_unit]’s slot scan
learns, kept rather than discarded.
segment_expl_statements needs only last; the formatter’s conditional
layout needs branches, because where greedy attachment put a branch group
is an accident of the surrounding tokens and must not be a layout input. In
\tl_if_empty:nTF {#1} {T} {F} the branches hang off the head command, but a
single-token slot breaks attachment and hands them to a sibling
(\seq_if_in:NnTF \l_seq {item} {T} {F} peels all three off \l_seq) or to
the stream itself (\int_compare:nNnTF {a} = {1} {T} {F}, where the relation
is a WORD). The scan resolves all three the same way, so the branch ranges
are the one handle that works for every shape.
Fields§
§last: usizeLast sibling index the unit spans (the head itself for a zero-arity or entirely head-internal unit).
branches: Vec<TextRange>The T/F branch groups, in argspec order. Empty for a non-conditional
head, and also for a unit a blank line cut short before every branch slot
was filled.