Expand description
Lossless syntax trees, builders, and text-preserving edits for R DCF files.
Parsing is infallible: every input byte is represented in the syntax tree, while malformed constructs are reported separately as diagnostics.
§R DCF dialect
R package metadata uses a dialect derived from Debian Control Files. It is
not interchangeable with Debian’s deb822 application rules: R field names
are matched case-sensitively, duplicate declarations must remain available
to callers, and # lines do not receive debian/control comment semantics.
This crate also validates the portable field-name grammar used by R and
unfolds dot-only continuation lines as logical blank lines.
These differences are why this crate has its own syntax model rather than
exposing deb822-lossless as the raw
layer. The parser retains malformed text in Rowan error nodes, preserves
physical whitespace and line endings, and offers exact first/last duplicate
lookup for the higher-level R metadata crates.
Re-exports§
pub use make::FormatStyle;pub use make::LineEnding;pub use make::document;pub use make::field;pub use make::record;
Modules§
- make
- Canonical text builders.
Structs§
- Diagnostic
- A parser diagnostic with a stable category and byte span.
- Editor
- A chainable editing session. Each operation is atomic;
finishreturns the latest persistent parse. - Field
- Typed valid DCF field.
- Field
Name - A validated, case-sensitive DCF field name.
- Invalid
Field Name - Error returned for a field name outside the portable R DCF grammar.
- Invalid
Logical Value - Error returned when logical text cannot be represented without ambiguity.
- Logical
Value - An owned logical value, with physical line endings excluded.
- Parse
- Persistent parse result owning only a Rowan green tree and shared diagnostics.
- Record
- Typed DCF record.
- Root
- Typed document root.
- Source
Span - A byte span in the UTF-8 source text.
- Value
Text - Owned unfolded field text and the enclosing physical source range.
Enums§
- DcfLanguage
- Rowan language marker for R DCF trees.
- Diagnostic
Kind - Stable category assigned to a parse diagnostic.
- Edit
Error - Failure to apply a structured edit.
- Syntax
Kind - The kinds of nodes and tokens in an R DCF syntax tree.
Functions§
- parse
- Parses UTF-8 R DCF text into a lossless syntax tree.
Type Aliases§
- Syntax
Element - A typed Rowan node-or-token element.
- Syntax
Node - A typed Rowan syntax node.
- Syntax
Token - A typed Rowan syntax token.