• Stars
    star
    335
  • Rank 125,904 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust grammar for tree-sitter

tree-sitter-rust

Build/test

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.
  • Keywords and Operators and Symbols.
  • Archive of the outdated Syntax Index that contains examples of all syntax in Rust cross-referenced with the section of The Book that describes it.

More Repositories

1

tree-sitter

An incremental parsing system for programming tools
Rust
18,352
star
2

py-tree-sitter

Python bindings to the Tree-sitter parsing library
C
825
star
3

node-tree-sitter

Node.js bindings for tree-sitter
C++
464
star
4

tree-sitter-javascript

Javascript grammar for tree-sitter
JavaScript
272
star
5

tree-sitter-typescript

TypeScript grammar for tree-sitter
JavaScript
272
star
6

tree-sitter-python

Python grammar for tree-sitter
JavaScript
261
star
7

tree-sitter-go

Go grammar for tree-sitter
JavaScript
224
star
8

tree-sitter-cpp

C++ grammar for tree-sitter
JavaScript
198
star
9

tree-sitter-graph

Construct graphs from parsed source code
Rust
196
star
10

tree-sitter-c-sharp

C# Grammar for tree-sitter
JavaScript
190
star
11

tree-sitter-c

C grammar for tree-sitter
JavaScript
175
star
12

tree-sitter-haskell

Haskell grammar for tree-sitter.
C
155
star
13

tree-sitter-scala

Scala grammar for tree-sitter
JavaScript
153
star
14

haskell-tree-sitter

Haskell bindings for tree-sitter
Haskell
152
star
15

tree-sitter-bash

Bash grammar for tree-sitter
JavaScript
152
star
16

tree-sitter-ruby

Ruby grammar for tree-sitter
JavaScript
137
star
17

tree-sitter-verilog

SystemVerilog grammar for tree-sitter
JavaScript
91
star
18

tree-sitter-java

Java grammar for tree-sitter
JavaScript
86
star
19

tree-sitter-json

JSON grammar for tree-sitter
Makefile
86
star
20

tree-sitter-php

PHP grammar for tree-sitter
JavaScript
86
star
21

tree-sitter-html

HTML grammar for Tree-sitter
C++
82
star
22

tree-sitter-julia

Julia grammar for Tree-sitter
JavaScript
78
star
23

tree-sitter-ocaml

OCaml grammar for tree-sitter
JavaScript
74
star
24

tree-sitter-css

CSS grammar for Tree-sitter
JavaScript
66
star
25

ruby-tree-sitter.old

Ruby bindings to tree-sitter
C
60
star
26

tree-sitter-swift

Swift grammar for tree-sitter
JavaScript
56
star
27

tree-sitter-regex

Tree-sitter parser for regular expressions
JavaScript
47
star
28

tree-sitter-cli

CLI tool for creating and testing tree-sitter parsers
JavaScript
43
star
29

tree-sitter-embedded-template

Tree-sitter grammar for embedded template languages like ERB, EJS
C
34
star
30

rust-tree-sitter

Rust bindings to Tree-sitter
Rust
30
star
31

tree-sitter-agda

Agda grammar for tree-sitter
Yacc
29
star
32

tree-sitter-jsdoc

JSDoc grammar for Tree-sitter
Rust
20
star
33

tree-sitter-ql

tree-sitter grammar for the CodeQL language
JavaScript
17
star
34

tree-sitter.github.io

Source HTML for the Tree-sitter organization site
JavaScript
10
star
35

highlight-schema

Schema for syntax highlighting property sheets
JavaScript
7
star
36

csharp-tree-sitter

C# bindings to the Tree-sitter parsing library
C#
6
star
37

tree-sitter-tsq

tree-sitter grammar for the tree-sitter query language
JavaScript
6
star
38

afl-tree-sitter

AFL test harness for tree-sitter runtime and parsers
C
5
star
39

tree-sitter-fluent

JavaScript
4
star
40

tree-sitter-razor

(WIP) C# Razor grammar for tree-sitter
C
4
star
41

tree-sitter-ql-dbscheme

tree-sitter support for `.dbscheme` files (as used in CodeQL).
JavaScript
2
star
42

.github

Tree-sitter organization info
2
star