Skip to main content

Crate panproto_expr_parser

Crate panproto_expr_parser 

Source
Expand description

Haskell-style surface syntax parser for panproto expressions.

Parses a human-readable functional language into panproto’s native representation types: Expr, InstanceQuery, FieldTransform, DirectedEquation, and WInstance of ThExpr.

The surface syntax supports list comprehensions, do-notation, let/where bindings, case/of with guards, lambda expressions, curried application, function composition, operator sections, record syntax with punning, pattern matching, and -> for graph edge traversal.

Re-exports§

pub use lexer::LexError;
pub use lexer::tokenize;
pub use parser::parse;
pub use pretty::pretty_print;
pub use token::Span;
pub use token::Spanned;
pub use token::Token;

Modules§

lexer
Lexer with layout insertion pass. Lexer producing a sequence of spanned tokens from source text.
parser
Chumsky parser producing Expr from the token stream. Chumsky parser producing panproto_expr::Expr from the token stream.
pretty
Pretty printer converting Expr back to surface syntax. Pretty printer for panproto expressions.
token
Token types for the surface syntax. Token types for the Haskell-style surface syntax.