Crate pomelo_parse

source ·
Expand description

Parser for SML ’97.

Currently, this only covers the Core language (no support for modules).

The design of this module is heavily influenced by rust-analyzer/crates/parser, and uses rowan to construct the syntax tree. It is also influenced by apollo_parser, a GraphQL parser in Rust that also draws from rust-analyzer.

TODO: Maybe add some examples here?

Re-exports

pub use ast::AstPtr;
pub use ast::AstToken;

Modules

Representation of the AST.
grammar 🔒
Functions to parse the SML Core language.
Boilerplate for making the rowan stuff work.
parser 🔒
Defines the parse tokens, parser interface, and output syntax tree.
Validation passes to run after the AST is constructed.
syntax 🔒
Kinds of syntax nodes.

Macros

Structs

An parsing error.
The main interface for manipulating the lexed source.
Output of the parsing stage.

Enums

Kinds of syntax nodes in the Core SML language.

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.

Functions

Lex and parse an input string.