6 releases (3 stable)
1.1.0 | Sep 6, 2024 |
---|---|
1.0.1 | Jun 14, 2024 |
0.19.5 | Feb 28, 2022 |
0.19.4 | Nov 11, 2021 |
0.19.3 | Aug 31, 2021 |
#57 in Parser tooling
228 downloads per month
5.5MB
172K
SLoC
tree-sitter-r
An R grammar for tree-sitter.
Rust bindings
This grammar is available as a Rust crate on crates.io.
References
lib.rs
:
This crate provides R language support for the tree-sitter parsing library.
Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_r::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading R parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());