Skip to main content

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//!
19//! The parser preserves all source text: `reconstruct(&parse(text).syntax())`
20//! is always `text`.
21
22pub mod ast;
23pub mod dcf;
24pub mod directive;
25pub mod parser;
26pub mod syntax;