Package: tree-sitter-rust
  • JavaScript 68.9%
  • C 22.3%
  • Tree-sitter Query 8.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Balazs Horvath 115170c0a6
Some checks failed
CI / Test parser (push) Has been cancelled
CI / Test parser-1 (push) Has been cancelled
CI / Test parser-2 (push) Has been cancelled
use tree-sitter lib instead of tree-sitter-language
2026-06-07 14:06:11 +02:00
.github Disable regeneration 2026-03-19 10:14:50 -07:00
bindings use tree-sitter lib instead of tree-sitter-language 2026-06-07 14:06:11 +02:00
examples build: update bindings and workflows 2024-04-07 00:00:44 -04:00
queries Update tags.scm (#249) 2024-12-18 20:48:51 -08:00
src Fix bad error recovery when parsing repeated string literals (#307) 2026-03-27 13:29:44 -07:00
test/corpus Fix bad error recovery when parsing repeated string literals (#307) 2026-03-27 13:29:44 -07:00
.editorconfig build: update bindings 2024-11-10 00:43:45 -05:00
.gitattributes build: update bindings 2024-11-10 00:43:45 -05:00
.gitignore build: update bindings 2024-10-15 04:30:44 +00:00
binding.gyp build: update bindings 2024-09-02 05:16:51 -04:00
Cargo.lock 0.24.1 2026-03-19 09:50:26 -07:00
Cargo.toml use tree-sitter lib instead of tree-sitter-language 2026-06-07 14:06:11 +02:00
CMakeLists.txt 0.24.2 2026-03-27 14:05:57 -07:00
eslint.config.mjs build: update bindings 2024-10-15 04:30:44 +00:00
go.mod build: update bindings 2024-11-10 00:43:45 -05:00
go.sum build: update bindings 2024-11-10 00:43:45 -05:00
grammar.js Fix bad error recovery when parsing repeated string literals (#307) 2026-03-27 13:29:44 -07:00
LICENSE Init 2017-03-29 19:15:15 +03:00
Makefile 0.24.2 2026-03-27 14:05:57 -07:00
package-lock.json 0.24.1 2026-03-19 09:50:26 -07:00
package.json 0.24.2 2026-03-27 14:05:57 -07:00
Package.resolved Raw reference/identifier conflict (#288) 2025-10-06 08:16:35 -07:00
Package.swift Raw reference/identifier conflict (#288) 2025-10-06 08:16:35 -07:00
pyproject.toml 0.24.2 2026-03-27 14:05:57 -07:00
README.md build: update bindings and workflows 2024-04-07 00:00:44 -04:00
setup.py build: update bindings 2024-09-02 05:16:51 -04:00
tree-sitter.json 0.24.2 2026-03-27 14:05:57 -07:00

tree-sitter-rust

CI discord matrix crates npm pypi

Rust grammar for tree-sitter.

Features

  • 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.

References