Expand description
Concrete syntax tree (CST) foundation built on rowan.
The v2 parser produces a lossless SyntaxNode tree: every byte of
input source — including whitespace and comments — is reachable
from the root via tokens, and walking the tree back to a string
yields the original bytes (verbatim).
This module defines:
SyntaxKind— the unified token + node taxonomy. Every leaf in aSyntaxNodehas a leafSyntaxKind; every composite branch has a nodeSyntaxKind.RelonLanguage— the rowan-side phantom that fixes theSyntaxNode/SyntaxToken/SyntaxElementtype aliases to ourSyntaxKind.
The kinds are organised into ranges so callers can ask “is this a trivia leaf?”, “is this a punctuation leaf?”, “is this a composite node?” without an exhaustive match.
Enums§
- Relon
Language - rowan-side phantom that ties
SyntaxKindto rowan’s tree generics. Don’t construct an instance — it’s used only at the type level. - Syntax
Kind - All token and node kinds the v2 parser produces. The discriminant is
kept stable and small (
u16) so rowan’s green tree can stash it efficiently — and so adding a new kind in the middle would shift values, change the boundary checks below. Append-only is the rule: new kinds go beforeSyntaxKind::__LAST.
Type Aliases§
- Syntax
Element - Syntax
Node - Convenience aliases. The vast majority of consumers should reach for these instead of touching rowan generics directly.
- Syntax
Token