Expand description
Syntax tree (CST and AST) related utilities for working with WebAssembly Text Format.
The red-green tree implementation is heavily inspired by rowan, but not a fork.
Modules§
- ast
- Abstract Syntax Tree, layered on top of untyped
SyntaxNodes.
Structs§
- Amber
Node - Node in the amber syntax tree.
- Amber
Token - Leaf token in the amber syntax tree.
- Green
Node - Node in the green syntax tree.
- Green
Token - Leaf token in the green syntax tree.
- Syntax
Node - Node in the red syntax tree.
- Syntax
Node Children - The iterator over the child nodes of a
SyntaxNode. - Syntax
Node Ptr - A “pointer” to a
SyntaxNode, carrying syntax kind and text range. - Syntax
Token - Leaf token in the red syntax tree.
- Text
Range - A range in text, represented as a pair of
TextSize. - Text
Size - A measure of text length. Also, equivalently, an index into text.
Enums§
- Node
OrToken - Type that represents tree element which may be either a node or a token.
- Syntax
Kind - Syntax kind enum for nodes and tokens.
- Token
AtOffset - The result type of
SyntaxNode::token_at_offsetmethod, representing there may be zero, one or two tokens at the given offset.
Traits§
- Syntax
Kind Match - Trait for matching syntax kinds, used in
*_by_kindmethods.