Crates.io | tree-sitter-rust |
lib.rs | tree-sitter-rust |
version | 0.23.1 |
source | src |
created_at | 2021-03-04 17:56:42.718422 |
updated_at | 2024-11-10 05:44:49.809239 |
description | Rust grammar for tree-sitter |
homepage | |
repository | https://github.com/tree-sitter/tree-sitter-rust |
max_upload_size | |
id | 363814 |
size | 6,461,732 |
Rust grammar for tree-sitter.
Speed — When initially parsing a file, tree-sitter-rust
takes 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.