Software
Placeholder

tree-sitter-r

Tree-sitter grammar for R

R

tree-sitter-r is a grammar for parsing R code using the tree-sitter parsing framework. It enables syntax analysis and code manipulation for R across multiple programming languages.

The grammar is available as bindings for R, Rust, and Node.js, making it accessible across different development environments. It closely follows the official R language specification but treats ]] as a single literal token rather than two separate tokens, which simplifies working with subset operations and maintains consistency with how other bracket pairs are handled. This deviation from the official R grammar has minimal practical impact since splitting ]] across lines is extremely rare in real-world R code.

Contributors