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

Download history 93/week @ 2024-07-29 90/week @ 2024-08-05 128/week @ 2024-08-12 172/week @ 2024-08-19 183/week @ 2024-08-26 308/week @ 2024-09-02 266/week @ 2024-09-09 127/week @ 2024-09-16 174/week @ 2024-09-23 142/week @ 2024-09-30 116/week @ 2024-10-07 62/week @ 2024-10-14 49/week @ 2024-10-21 49/week @ 2024-10-28 57/week @ 2024-11-04 68/week @ 2024-11-11

228 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