Module pomelo_parse::ast

source ·
Expand description

Representation of the AST.

This follows rowan::ast. The basic idea is to try to “cast” the nodes of the concrete syntax tree (CST) to AST nodes based on their SyntaxKind. This is achieved with the AstNode and AstToken traits in this module.

Re-exports

pub use constants::*;
pub use bindings::*;
pub use declarations::*;
pub use expressions::*;
pub use identifiers::*;
pub use matches::*;
pub use patterns::*;
pub use type_expressions::*;

Modules

AST nodes for bindings.
AST nodes for constants (literals).
AST nodes for declarations.
AST nodes for expressions.
AST nodes for identifiers.
AST nodes for matches.
AST nodes for patterns.
AST nodes for types and type expressions.
util 🔒

Structs

Traits

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 node itself.

Type Definitions