fatou_parser/parser.rs
1//! The parse pipeline: `lex → parse_expr (Pratt) + structural (recursive
2//! descent) → events → build_tree → rowan CST`.
3//!
4//! Losslessness is the core invariant: `reconstruct(text) == text` for all
5//! inputs. The grammar is a walking skeleton over a Julia subset and grows
6//! incrementally (see `TODO.md`). Incremental reparse splicing lives in
7//! [`reparse`] (a single edit) and [`reparse_edits`] (a chain of them); both
8//! return `None` when no strategy applies, and the host's salsa layer
9//! (`fatou::incremental`) then does a full parse.
10
11mod context;
12mod core;
13mod cursor;
14mod diagnostics;
15mod edit;
16mod events;
17mod expr;
18mod lexer;
19mod recovery;
20mod reparse;
21mod sexpr;
22mod structural;
23mod tree_builder;
24mod unicode_ident;
25mod unicode_ops;
26
27pub use core::{ParseDiagnostic, ParseOutput, parse, reconstruct};
28// Semver-loose: exposed for the fatou CLI's completion and semantic layers,
29// not a stable part of this crate's API.
30pub use lexer::{KEYWORDS, is_ident_continue, is_ident_start};
31pub use reparse::{
32 Edit, ReparseTier, Reparsed, apply_edits, diff_edit, reparse, reparse_edits, try_apply_edits,
33};
34// Test support, not API: the in-crate Tenet-4 assert and the
35// `tests/incremental_reparse.rs` oracle harness share this one definition so
36// they can never diverge, which is the only reason it is `pub` at all.
37#[doc(hidden)]
38pub use reparse::fingerprint;
39pub use sexpr::{normalize_sexpr, to_juliasyntax_sexpr};