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

#45 in Parser tooling

Download history 142/week @ 2024-07-11 108/week @ 2024-07-18 95/week @ 2024-07-25 87/week @ 2024-08-01 118/week @ 2024-08-08 166/week @ 2024-08-15 175/week @ 2024-08-22 136/week @ 2024-08-29 336/week @ 2024-09-05 248/week @ 2024-09-12 140/week @ 2024-09-19 151/week @ 2024-09-26 152/week @ 2024-10-03 72/week @ 2024-10-10 57/week @ 2024-10-17 33/week @ 2024-10-24

334 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