|
1 | 1 | # tree-sitter-rust
|
2 | 2 |
|
3 |
| -[](https://github.com/tree-sitter/tree-sitter-rust/actions/workflows/ci.yml) |
| 3 | +[](https://github.com/tree-sitter/tree-sitter-c/actions/workflows/ci.yml) |
4 | 4 |
|
5 | 5 | Rust grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
6 | 6 |
|
7 | 7 | ## Features
|
8 | 8 |
|
9 |
| -* **Speed** - When initially parsing a file, `tree-sitter-rust` takes around twice as long as Rustc's hand-coded parser. |
| 9 | +- **Speed** — When initially parsing a file, `tree-sitter-rust` takes around twice |
| 10 | + as long as Rustc's hand-coded parser. |
10 | 11 |
|
11 | 12 | ```sh
|
12 | 13 | $ wc -l examples/ast.rs
|
13 | 14 | 2157 examples/ast.rs
|
14 | 15 |
|
15 | 16 | $ rustc -Z ast-json-noexpand -Z time-passes examples/ast.rs | head -n1
|
16 |
| - time: 0.007 parsing # (7 ms) |
| 17 | + time: 0.007 parsing # (7 ms) |
17 | 18 |
|
18 | 19 | $ tree-sitter parse examples/ast.rs --quiet --time
|
19 |
| - examples/ast.rs 16 ms |
| 20 | + examples/ast.rs 16 ms |
20 | 21 | ```
|
21 | 22 |
|
22 |
| - 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. |
| 23 | + But if you _edit_ the file after parsing it, this parser can generally _update_ |
| 24 | + the previous existing syntax tree to reflect your edit in less than a millisecond, |
| 25 | + thanks to Tree-sitter's incremental parsing system. |
23 | 26 |
|
24 | 27 | ## References
|
25 | 28 |
|
26 |
| -* [The Rust Grammar Reference](https://doc.rust-lang.org/grammar.html) - The grammar reference provides chapters that formally define the language grammar. |
27 |
| -* [The Rust Reference](https://doc.rust-lang.org/reference/) - While Rust does not have a specification, the reference tries to describe its working in detail. It tends to be out of date. |
28 |
| -* [Keywords](https://doc.rust-lang.org/stable/book/appendix-01-keywords.html) and [Operators and Symbols](https://doc.rust-lang.org/stable/book/appendix-02-operators.html). |
29 |
| -* Archive of the outdated [Syntax Index](https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/syntax-index.html) that contains examples of all syntax in Rust cross-referenced with the section of The Book that describes it. |
| 29 | +- [The Rust Grammar Reference](https://doc.rust-lang.org/grammar.html) — The grammar |
| 30 | + reference provides chapters that formally define the language grammar. |
| 31 | +- [The Rust Reference](https://doc.rust-lang.org/reference/) — While Rust does |
| 32 | + not have a specification, the reference tries to describe its working in detail. |
| 33 | + It tends to be out of date. |
| 34 | +- [Keywords](https://doc.rust-lang.org/stable/book/appendix-01-keywords.html) and |
| 35 | + [Operators and Symbols](https://doc.rust-lang.org/stable/book/appendix-02-operators.html). |
| 36 | +- Archive of the outdated [Syntax Index](https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/syntax-index.html) |
| 37 | + that contains examples of all syntax in Rust cross-referenced with the section |
| 38 | + of The Book that describes it. |
0 commit comments