Rust grammar for tree-sitter
Project Links
Meta
Author: Max Brunsfeld, Amaan Qureshi
Requires Python: >=3.9
Classifiers
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Topic
- Software Development :: Compilers
- Text Processing :: Linguistic
Typing
- Typed
tree-sitter-rust
Rust grammar for tree-sitter.
Features
-
Speed — When initially parsing a file,
tree-sitter-rusttakes around two to three times as long as rustc's hand-written parser.$ wc -l examples/ast.rs 2157 examples/ast.rs $ rustc -Z unpretty=ast-tree -Z time-passes examples/ast.rs | head -n0 time: 0.002; rss: 55MB -> 60MB ( +5MB) parse_crate $ tree-sitter parse examples/ast.rs --quiet --time examples/ast.rs 6.48 ms 9908 bytes/ms
But if you edit the file after parsing it, tree-sitter can generally update the previous existing syntax tree to reflect your edit in less than a millisecond, thanks to its incremental parsing system.
References
- The Rust Reference — While Rust does not have a specification, the reference tries to describe its working in detail. It tends to be out of date.
- Keywords and Operators and Symbols.
0.24.0
Apr 01, 2025
0.23.3
Apr 01, 2025
0.23.2
Nov 24, 2024
0.23.1
Nov 10, 2024
0.23.0
Sep 02, 2024
0.21.2
Apr 25, 2024
0.21.1
Apr 25, 2024
0.0.1
Apr 07, 2024
Wheel compatibility matrix
Files in release
tree_sitter_rust-0.24.0-cp39-abi3-macosx_10_9_x86_64.whl (128.8KiB)
tree_sitter_rust-0.24.0-cp39-abi3-macosx_11_0_arm64.whl (134.7KiB)
tree_sitter_rust-0.24.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (162.7KiB)
tree_sitter_rust-0.24.0-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161.6KiB)
tree_sitter_rust-0.24.0-cp39-abi3-musllinux_1_2_x86_64.whl (159.0KiB)
tree_sitter_rust-0.24.0-cp39-abi3-win_amd64.whl (127.0KiB)
tree_sitter_rust-0.24.0-cp39-abi3-win_arm64.whl (125.6KiB)
tree_sitter_rust-0.24.0.tar.gz (328.0KiB)