#tree-sitter #incremental-parser #rust-orchard

tree-sitter-rust-orchard

Grammar for Rust that aims to be closer to the actual AST

15 breaking releases

new 0.16.0 Dec 23, 2025
0.15.0 Nov 27, 2025
0.14.0 Oct 26, 2025
0.11.0 Jul 25, 2025

#843 in Parser implementations

Download history 53/week @ 2025-08-26 251/week @ 2025-09-02 388/week @ 2025-09-09 780/week @ 2025-09-16 1436/week @ 2025-09-23 1485/week @ 2025-09-30 1413/week @ 2025-10-07 1073/week @ 2025-10-14 1129/week @ 2025-10-21 688/week @ 2025-10-28 658/week @ 2025-11-04 1250/week @ 2025-11-11 1056/week @ 2025-11-18 1035/week @ 2025-11-25 539/week @ 2025-12-02 349/week @ 2025-12-09

3,172 downloads per month
Used in 2 crates

MIT license

12MB
370K SLoC

C 368K SLoC // 0.0% comments JavaScript 1.5K SLoC // 0.0% comments Scheme 171 SLoC // 0.1% comments Rust 32 SLoC

This crate provides Rust language support for the tree-sitter parsing library.

Typically, you will use the LANGUAGE constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
fn double(x: i32) -> i32 {
    x * 2
}
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_rust_orchard::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Rust parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

tree-sitter-rust-orchard

crates pypi

This is a fork of the tree-sitter-rust grammar. It focuses on:

  • faithfulness of the produced trees with the semantics of Rust
  • ability to parse Rust files with recent syntactic constructs
  • proactive reviewing of contributions and onboarding of their authors into the project, via the governance model

Note that unlike upstream, generated files are not checked into git, so you need to run tree-sitter generate after cloning this repository.

Contributions are welcome, so are co-maintainers.

Dependencies