Expand description
Typed AST wrappers over CST nodes.
Each struct wraps a SyntaxNode and provides typed accessors.
Cast is infallible for correct SyntaxKind - validation happens elsewhere.
§String Lifetime Limitation
SyntaxToken::text() returns &str tied to the token’s lifetime, not to the
source &'src str. This is a rowan design: tokens store interned strings, not
spans into the original source.
When building data structures that need source-lifetime strings (e.g.,
SymbolTable<'src>), use token_src instead of token.text().
Structs§
- AltExpr
- Anchor
- Anonymous
Node - Anonymous node: string literal (
"+") or wildcard (_). Maps from CSTStrorWildcard. - Branch
- Captured
Expr - Def
- Field
Expr - Named
Node - Negated
Field - Quantified
Expr - Ref
- Root
- SeqExpr
- Type
Enums§
- AltKind
- Whether an alternation uses tagged or untagged branches.
- Expr
- Expression: any pattern that can appear in the tree.
- SeqItem
- Either an expression or an anchor in a sequence.
Functions§
- token_
src - Extracts token text with source lifetime.