r_dcf_syntax/lib.rs
1//! Lossless syntax trees, builders, and text-preserving edits for R DCF files.
2//!
3//! Parsing is infallible: every input byte is represented in the syntax tree,
4//! while malformed constructs are reported separately as diagnostics.
5//!
6//! # R DCF dialect
7//!
8//! R package metadata uses a dialect derived from Debian Control Files. It is
9//! not interchangeable with Debian's deb822 application rules: R field names
10//! are matched case-sensitively, duplicate declarations must remain available
11//! to callers, and `#` lines do not receive `debian/control` comment semantics.
12//! This crate also validates the portable field-name grammar used by R and
13//! unfolds dot-only continuation lines as logical blank lines.
14//!
15//! These differences are why this crate has its own syntax model rather than
16//! exposing [`deb822-lossless`](https://docs.rs/deb822-lossless) as the raw
17//! layer. The parser retains malformed text in Rowan error nodes, preserves
18//! physical whitespace and line endings, and offers exact first/last duplicate
19//! lookup for the higher-level R metadata crates.
20
21mod ast;
22mod edit;
23pub mod make;
24mod parser;
25mod syntax;
26mod value;
27
28#[cfg(test)]
29mod tests;
30
31pub use ast::{Field, Record, Root, ValueText};
32pub use edit::{EditError, Editor};
33pub use make::{FormatStyle, LineEnding, document, field, record};
34pub use parser::{Diagnostic, DiagnosticKind, Parse, SourceSpan, parse};
35pub use syntax::{DcfLanguage, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken};
36pub use value::{FieldName, InvalidFieldName, InvalidLogicalValue, LogicalValue};