Skip to content
Switch branches/tags

Latest commit

With the rise in supply chain attacks and OSS dependencies being used as a attack vector, Microsoft is working with our ecosystem partners, such as the Linux Foundation's OpenSSF, to enable OSS consumers to track packages back to their public sources.
We've identified that the following packages published to NPM do not report where sources can be found, typically accomplished by including a link to your GitHub repository in your `package.json` REPOSITORY field. This PR was created to add this value, ensuring future releases will include this provenance information.
Published NPM packages with repository information:
* tree-sitter-rust

Git stats


Failed to load latest commit information.



Rust grammar for tree-sitter


  • Speed - When initially parsing a file, tree-sitter-rust takes around twice as long as Rustc's hand-coded parser.

    $ wc -l examples/
      2157 examples/
    $ rustc -Z ast-json-noexpand -Z time-passes examples/ | head -n1
      time: 0.007	parsing # (7 ms)
    $ tree-sitter parse examples/ --quiet --time
      examples/	16 ms

    But if you edit the file after parsing it, this parser can generally update the previous existing syntax tree to reflect your edit in less than a millisecond, thanks to Tree-sitter's incremental parsing system.


  • The Rust Grammar Reference - The grammar reference provides chapters that formally define the language grammar.
  • 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.
  • Syntax Index - This appendix from The Book contains examples of all syntax in Rust cross-referenced with the section of The Book that describes it.