Skip to main content

panproto_expr_parser/
lib.rs

1//! Haskell-style surface syntax parser for panproto expressions.
2//!
3//! Parses a human-readable functional language into panproto's native
4//! representation types: `Expr`, `InstanceQuery`, `FieldTransform`,
5//! `DirectedEquation`, and `WInstance` of `ThExpr`.
6//!
7//! The surface syntax supports list comprehensions, do-notation, let/where
8//! bindings, case/of with guards, lambda expressions, curried application,
9//! function composition, operator sections, record syntax with punning,
10//! pattern matching, and `->` for graph edge traversal.
11
12/// Token types for the surface syntax.
13pub mod token;
14
15/// Lexer with layout insertion pass.
16pub mod lexer;
17
18/// Chumsky parser producing `Expr` from the token stream.
19pub mod parser;
20
21/// Pretty printer converting `Expr` back to surface syntax.
22pub mod pretty;
23
24// Re-exports for convenience.
25pub use lexer::{LexError, tokenize};
26pub use parser::parse;
27pub use pretty::pretty_print;
28pub use token::{Span, Spanned, Token};