Skip to content

Commit d6e8c6b

Browse files
committed
build: update bindings and workflows
1 parent 2e5682b commit d6e8c6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+116615
-114722
lines changed

.editorconfig

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{json,toml,yml,gyp}]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.js]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.rs]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.{c,cc,h}]
22+
indent_style = space
23+
indent_size = 4
24+
25+
[*.{py,pyi}]
26+
indent_style = space
27+
indent_size = 4
28+
29+
[*.swift]
30+
indent_style = space
31+
indent_size = 4
32+
33+
[*.go]
34+
indent_style = tab
35+
indent_size = 8
36+
37+
[Makefile]
38+
indent_style = tab
39+
indent_size = 8

.eslintrc.js

-20
This file was deleted.

.gitattributes

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/src/** linguist-vendored
2-
/examples/* linguist-vendored
1+
* text eol=lf
32

4-
src/grammar.json linguist-generated
5-
src/node-types.json linguist-generated
3+
src/*.json linguist-generated
64
src/parser.c linguist-generated
5+
src/tree_sitter/* linguist-generated
76

8-
src/grammar.json -diff
9-
src/node-types.json -diff
10-
src/parser.c -diff
7+
bindings/** linguist-generated
8+
binding.gyp linguist-generated
9+
setup.py linguist-generated
10+
Makefile linguist-generated
11+
Package.swift linguist-generated

.gitignore

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
1+
# Rust artifacts
12
Cargo.lock
2-
node_modules
3-
build
4-
*.log
5-
package-lock.json
6-
/examples
7-
!examples/ast.rs
8-
!examples/weird-exprs.rs
9-
/target/
10-
/fuzzer/
3+
target/
4+
5+
# Node artifacts
6+
build/
7+
prebuilds/
8+
node_modules/
9+
*.tgz
10+
11+
# Swift artifacts
12+
.build/
13+
14+
# Go artifacts
15+
go.sum
16+
_obj/
17+
18+
# Python artifacts
19+
.venv/
20+
dist/
21+
*.egg-info
22+
*.whl
23+
24+
# C artifacts
25+
*.a
26+
*.so
27+
*.so.*
28+
*.dylib
29+
*.dll
30+
*.pc
31+
32+
# Example dirs
33+
/examples/*/
34+
35+
# Grammar volatiles
36+
*.wasm
37+
*.obj
38+
*.o

.npmignore

-6
This file was deleted.

Cargo.toml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[package]
22
name = "tree-sitter-rust"
33
description = "Rust grammar for tree-sitter"
4-
version = "0.20.4"
5-
authors = ["Max Brunsfeld <[email protected]>"]
4+
version = "0.21.0"
5+
authors = [
6+
"Max Brunsfeld <[email protected]>",
7+
"Amaan Qureshi <[email protected]>",
8+
]
69
license = "MIT"
7-
readme = "bindings/rust/README.md"
8-
keywords = ["incremental", "parsing", "rust"]
10+
keywords = ["incremental", "parsing", "tree-sitter", "rust"]
911
categories = ["parsing", "text-editors"]
1012
repository = "https://github.com/tree-sitter/tree-sitter-rust"
1113
edition = "2021"
@@ -18,7 +20,7 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
1820
path = "bindings/rust/lib.rs"
1921

2022
[dependencies]
21-
tree-sitter = "~0.20.10"
23+
tree-sitter = ">=0.21.0"
2224

2325
[build-dependencies]
24-
cc = "~1.0.82"
26+
cc = "~1.0.90"

Makefile

+111
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

+21-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,41 @@
55
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
66
[![crates][crates]](https://crates.io/crates/tree-sitter-rust)
77
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-rust)
8+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-rust)
89

9-
Rust grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
10+
Rust grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
1011

1112
## Features
1213

13-
- **Speed** — When initially parsing a file, `tree-sitter-rust` takes around twice
14-
as long as Rustc's hand-coded parser.
14+
- **Speed** — When initially parsing a file, `tree-sitter-rust` takes around two to three times
15+
as long as rustc's hand-written parser.
1516

1617
```sh
1718
$ wc -l examples/ast.rs
1819
2157 examples/ast.rs
1920

20-
$ rustc -Z ast-json-noexpand -Z time-passes examples/ast.rs | head -n1
21-
time: 0.007 parsing # (7 ms)
21+
$ rustc -Z unpretty=ast-tree -Z time-passes examples/ast.rs | head -n0
22+
time: 0.002; rss: 55MB -> 60MB ( +5MB) parse_crate
2223

2324
$ tree-sitter parse examples/ast.rs --quiet --time
24-
examples/ast.rs 16 ms
25+
examples/ast.rs 6.48 ms 9908 bytes/ms
2526
```
2627

27-
But if you _edit_ the file after parsing it, this parser can generally _update_
28+
But if you _edit_ the file after parsing it, tree-sitter can generally _update_
2829
the previous existing syntax tree to reflect your edit in less than a millisecond,
29-
thanks to Tree-sitter's incremental parsing system.
30+
thanks to its incremental parsing system.
3031

3132
## References
3233

33-
- [The Rust Grammar Reference](https://doc.rust-lang.org/grammar.html) — The grammar
34-
reference provides chapters that formally define the language grammar.
3534
- [The Rust Reference](https://doc.rust-lang.org/reference/) — While Rust does
3635
not have a specification, the reference tries to describe its working in detail.
3736
It tends to be out of date.
3837
- [Keywords](https://doc.rust-lang.org/stable/book/appendix-01-keywords.html) and
3938
[Operators and Symbols](https://doc.rust-lang.org/stable/book/appendix-02-operators.html).
40-
- 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)
41-
that contains examples of all syntax in Rust cross-referenced with the section
42-
of The Book that describes it.
4339

4440
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-rust/ci.yml?logo=github&label=CI
4541
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
4642
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
4743
[npm]: https://img.shields.io/npm/v/tree-sitter-rust?logo=npm
4844
[crates]: https://img.shields.io/crates/v/tree-sitter-rust?logo=rust
45+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-rust?logo=pypi&logoColor=ffd242

0 commit comments

Comments
 (0)