a structural diff that understands syntax 🟥🟩
 
 
 
 
 
Go to file
calixteman a84c7c7d5c Fix parse error when a comment was inside a string (#42)
* Fix parse error when a comment was inside a string

* Update parser.c
2019-07-18 11:30:39 +07:00
corpus Fix parse error when a comment was inside a string (#42) 2019-07-18 11:30:39 +07:00
examples Use a shell script instead of submodules to fetch example repos 2019-06-10 14:39:07 +07:00
properties Add highlighting properties for brackets and delimiters 2019-06-11 09:56:21 +07:00
script Use a shell script instead of submodules to fetch example repos 2019-06-10 14:39:07 +07:00
src Fix parse error when a comment was inside a string (#42) 2019-07-18 11:30:39 +07:00
.gitattributes Don't count generated files in github language stats 2018-01-22 09:05:38 +07:00
.gitignore Use a shell script instead of submodules to fetch example repos 2019-06-10 14:39:07 +07:00
.gitmodules Use a shell script instead of submodules to fetch example repos 2019-06-10 14:39:07 +07:00
.npmignore Update npmignore 2018-07-18 12:43:53 +07:00
.travis.yml Use node 10 on travis 2019-06-10 09:15:05 +07:00
LICENSE Init 2017-03-29 19:15:15 +07:00
README.md Remove attempts to parse token tree contents as items and expressions 2019-06-10 11:11:10 +07:00
appveyor.yml Add appveyor config 2018-08-02 16:13:21 +07:00
binding.gyp Tokenize raw string literals using an external scanner 2018-02-17 14:14:40 +07:00
grammar.js Fix parse error when a comment was inside a string (#42) 2019-07-18 11:30:39 +07:00
index.js Upgrade to tree-sitter-cli 0.15.3 2019-06-07 15:11:47 +07:00
package.json ⬆️ tree-sitter 2019-07-17 16:02:33 +07:00

README.md

tree-sitter-rust

Build Status Build status

Rust grammar for tree-sitter

Features

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

    $ wc -l examples/ast.rs
      2157 examples/ast.rs
    
    $ rustc -Z ast-json-noexpand -Z time-passes examples/ast.rs | head -n1
      time: 0.007	parsing # (7 ms)
    
    $ tree-sitter parse examples/ast.rs --quiet --time
      examples/ast.rs	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.

References

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