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 workspace::find_manifest;pub use workspace::Manifest;pub use workspace::PackageError;pub use parser::parse;pub use parser::parse_with_src;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
- workspace
lex.tomlmanifest parsing and package resolution.
Enums§
Functions§
- parse_
source - Convenience: lex + parse a source string.
- parse_
source_ with_ positions - Variant of
parse_sourcethat also returns the byte-offset position of each top-levelfndeclaration insrc. Used by thelex checkCLI (and any other LLM-facing tooling) to stamp source positions ontolex_types::PositionedErrors.
Type Aliases§
- FnPositions
- Byte-offset start position of each
fndeclaration, keyed by function name (#306 slice 1). Used bylex_types::Positionrenderers to map a type error back to itsfnlocation.