Node
Supertype of every document node.
Nodes form a tree rooted at Root, reached through
Unit.nodes. The four intermediate supertypes --
Declaration, Param,
Block, and Reference -- group the
concrete kinds by what they carry, so a consumer can match on the level it
cares about.
Fields
doc @ (Span | nil)The span of the comment block documenting the node, or
nilwhere none attaches.Every node answers, rather than only the kinds that can be documented: which of them those are is the compiler's determination, and a consumer that has to know it in advance gains nothing.
parent @ (NodeId | nil)The ID of the enclosing node, or
nilforRoot.span @ (Span | nil)The span the node covers in the source, or
nilfor a prelude node, which has no source text.