Skip to main content

Crate wat_syntax

Crate wat_syntax 

Source
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§

AmberNode
Node in the amber syntax tree.
AmberToken
Leaf token in the amber syntax tree.
GreenNode
Node in the green syntax tree.
GreenToken
Leaf token in the green syntax tree.
SyntaxNode
Node in the red syntax tree.
SyntaxNodeChildren
The iterator over the child nodes of a SyntaxNode.
SyntaxNodePtr
A “pointer” to a SyntaxNode, carrying syntax kind and text range.
SyntaxToken
Leaf token in the red syntax tree.
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.

Enums§

NodeOrToken
Type that represents tree element which may be either a node or a token.
SyntaxKind
Syntax kind enum for nodes and tokens.
TokenAtOffset
The result type of SyntaxNode::token_at_offset method, representing there may be zero, one or two tokens at the given offset.

Traits§

SyntaxKindMatch
Trait for matching syntax kinds, used in *_by_kind methods.