Abstract Syntax Tree, layered on top of untyped
This module contains functions for editing syntax trees. As the trees are immutable, all function here return a fresh copy of the tree, instead of doing an in-place modification.
Structural editing for ast.
This module contains free-standing functions for creating AST fragments out of smaller pieces.
An iterator over
SyntaxNode children of a particular AST type.
The main trait to go from untyped
SyntaxNode to a typed ast. The
conversion itself has zero runtime cost: ast and syntax nodes have exactly
the same representation: a pointer to the tree root and a pointer to the
AstNode, but wraps tokens rather than interior nodes.