2 releases
new 0.1.1 | Sep 9, 2024 |
---|---|
0.1.0 | Aug 28, 2024 |
#1612 in Parser implementations
1,487 downloads per month
71KB
2K
SLoC
R DESCRIPTION parser
This crate provides a parser and editor for the DESCRIPTION
files used in R
packages. Since the format is based on Debian control files, the parser
uses the deb822_lossless
crate for the lower layer parsing.
See https://r-pkgs.org/description.html for more information on the format.
Example
use r_description::RDescription;
let desc = r_description::parse(r###"Package: foo
Version: 1.0
# Inline comment that will be preserved.
Depends: R (>= 3.0.0)
"###).unwrap();
assert_eq!(desc.get("Package"), Some("foo"));
assert_eq!(desc.get("Version"), Some("1.0"));
assert_eq!(desc.get("Depends"), Some("R (>= 3.0.0"));
desc.insert("License", "MIT");
Dependencies
~4–6MB
~136K SLoC