arity_parser/lib.rs
1//! Lossless CST parser, typed AST wrappers, and incremental reparser for the
2//! R language.
3//!
4//! This crate is the parsing engine of [arity](https://arity.cc), extracted so
5//! that other tools can build on it. The public surface mirrors the module
6//! layout of the `arity` crate itself:
7//!
8//! - [`syntax`] — `SyntaxKind`, the rowan language definition, and
9//! position-independent node pointers.
10//! - [`parser`] — the lossless parser (`parse`/`reconstruct`), diagnostics,
11//! the incremental reparse entry points (`reparse`, `apply_edits`), and the
12//! predicates that judge a parse against R's own acceptance rules
13//! (`is_single_expression`).
14//! - [`ast`] — zero-cost typed wrappers over the CST, in rust-analyzer's
15//! mould.
16//! - [`dcf`] — a second, independent grammar: a lossless CST for DCF, the
17//! format of R's `DESCRIPTION`.
18//! - [`namespace`] — a typed, lossless view of R package `NAMESPACE` files,
19//! built on the R CST without evaluating conditional directives.
20//!
21//! The parser preserves all source text: `reconstruct(&parse(text).syntax())`
22//! is always `text`.
23
24pub mod ast;
25pub mod dcf;
26pub mod directive;
27pub mod namespace;
28pub mod parser;
29pub mod syntax;