Expand description
M1: lexer, parser, syntax tree, pretty-printer for Lex.
See spec §3 for the grammar.
Re-exports§
pub use loader::load_program;pub use loader::load_program_from_str;pub use loader::LoadError;pub use parser::parse;pub use parser::ParseError;pub use printer::print_program;pub use token::lex;pub use token::LexError;pub use token::Token;pub use token::TokenKind;pub use syntax::*;
Modules§
- loader
- Multi-file loader: resolves
import "./...",import "../...", andimport "/abs/..."statements relative to the importer, recursively parses, and produces a singleProgramwith all stages merged. - parser
- Recursive-descent parser for Lex. Pratt-style precedence climbing for binary operators; everything else is straightforward LL(1)-with-lookahead.
- printer
- Pretty-printer for the syntax tree. Designed so
parse(text) → print → parseround-trips on the canonical AST. - syntax
- Syntax tree (the parser’s direct output, before canonicalization in §5).
- token
Enums§
Functions§
- parse_
source - Convenience: lex + parse a source string.