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

#89 in Parser tooling

Download history 170/week @ 2024-08-16 173/week @ 2024-08-23 131/week @ 2024-08-30 371/week @ 2024-09-06 212/week @ 2024-09-13 161/week @ 2024-09-20 142/week @ 2024-09-27 143/week @ 2024-10-04 65/week @ 2024-10-11 59/week @ 2024-10-18 40/week @ 2024-10-25 64/week @ 2024-11-01 63/week @ 2024-11-08 50/week @ 2024-11-15 70/week @ 2024-11-22 50/week @ 2024-11-29

247 downloads per month

MIT license

5.5MB
172K SLoC

C 171K SLoC // 0.0% comments JavaScript 390 SLoC // 0.3% comments Scheme 100 SLoC // 0.1% comments Rust 51 SLoC // 0.1% comments

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());

Dependencies