caixa_ast/lib.rs
1//! `caixa-ast` — span-aware Lisp AST, shared by caixa-fmt, caixa-lint,
2//! and caixa-lsp.
3//!
4//! Why a sibling of `tatara-lisp::Sexp`? Because tatara-lisp's reader
5//! throws away byte positions (it's a *compiler* — once the Sexp is
6//! typed, positions are slack). Tools care about positions: the
7//! formatter must re-emit at the original column; the linter must
8//! highlight the exact region; the LSP must compute ranges. This crate
9//! adds span + trivia (comments, blank lines) to every node while
10//! keeping a free conversion to the plain `tatara_lisp::Sexp` for the
11//! downstream compile pipeline.
12//!
13//! The surface grammar matches tatara-lisp exactly (list, symbol,
14//! keyword, string, int, float, bool, nil, quote/quasiquote/unquote/
15//! splice) — parse the same source, get equivalent trees.
16
17extern crate self as caixa_ast;
18
19pub mod lexer;
20pub mod node;
21pub mod parser;
22pub mod span;
23pub mod trivia;
24pub mod visit;
25
26pub use lexer::{Token, TokenKind, tokenize};
27pub use node::{Node, NodeKind};
28pub use parser::{ParseError, parse};
29pub use span::{Position, Span, line_column};
30pub use trivia::{Trivia, TriviaKind};
31pub use visit::{Visitor, walk};