pub struct CstNode {Show 14 fields
pub kind: CstNodeKind,
pub span: Span,
pub content_span: Span,
pub children: Vec<NodeId>,
pub parent: Option<NodeId>,
pub field_name: Option<Span>,
pub field_value: Option<Span>,
pub section_keyword: Option<Span>,
pub section_arg: Option<Span>,
pub condition_keyword: Option<Span>,
pub condition_expr: Option<Span>,
pub leading_trivia: Vec<TriviaPiece>,
pub trailing_trivia: Vec<TriviaPiece>,
pub indent: usize,
}Expand description
A single node in the CST arena.
Fields§
§kind: CstNodeKindWhat kind of syntax element this node represents.
span: SpanFull byte span of this node in the source, including leading trivia.
content_span: SpanSpan of just the meaningful content (excluding leading/trailing trivia that belongs to this node).
children: Vec<NodeId>Children of this node (indices into the arena).
parent: Option<NodeId>Parent node (None only for the Root).
field_name: Option<Span>For Field / Import nodes: span of the field name.
field_value: Option<Span>For Field / Import nodes: span of the field value (first line
only; continuation lines are child ValueLine nodes).
section_keyword: Option<Span>For Section nodes: span of the section keyword.
section_arg: Option<Span>For Section nodes: span of the section argument (e.g. my-exe).
condition_keyword: Option<Span>For Conditional nodes: span of the keyword (if / elif).
condition_expr: Option<Span>For Conditional nodes: span of the condition expression text.
leading_trivia: Vec<TriviaPiece>Leading trivia pieces (whitespace, newlines, comments) that precede this node’s content.
trailing_trivia: Vec<TriviaPiece>Trailing trivia pieces (typically a newline at the end of the line).
indent: usizeThe indentation level (visual column) of this node.