Skip to content

Commit 5425944

Browse files
feat: update to tree-sitter 0.24
1 parent 41940e1 commit 5425944

Some content is hidden

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

46 files changed

+2323
-804
lines changed

.editorconfig

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,45 @@ root = true
22

33
[*]
44
charset = utf-8
5-
end_of_line = lf
5+
6+
[*.{json,toml,yml,gyp}]
7+
indent_style = space
8+
indent_size = 2
9+
10+
[*.js]
11+
indent_style = space
612
indent_size = 2
13+
14+
[*.scm]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.{c,cc,h}]
19+
indent_style = space
20+
indent_size = 4
21+
22+
[*.rs]
23+
indent_style = space
24+
indent_size = 4
25+
26+
[*.{py,pyi}]
27+
indent_style = space
28+
indent_size = 4
29+
30+
[*.swift]
731
indent_style = space
8-
insert_final_newline = true
9-
trim_trailing_whitespace = true
32+
indent_size = 4
1033

11-
[grammar.js]
12-
quote_type = single
34+
[*.go]
35+
indent_style = tab
36+
indent_size = 8
37+
38+
[Makefile]
39+
indent_style = tab
40+
indent_size = 8
41+
42+
[parser.c]
43+
indent_size = 2
44+
45+
[{alloc,array,parser}.h]
46+
indent_size = 2

.gitattributes

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1-
* text eol=lf
1+
* text=auto eol=lf
22

3-
src/** linguist-generated
4-
bindings/** linguist-generated
5-
binding.gyp linguist-generated
3+
# Generated source files
4+
src/*.json linguist-generated
5+
src/parser.c linguist-generated
6+
src/tree_sitter/* linguist-generated
7+
8+
# C bindings
9+
bindings/c/* linguist-generated
10+
CMakeLists.txt linguist-generated
11+
Makefile linguist-generated
12+
13+
# Rust bindings
14+
bindings/rust/* linguist-generated
615
Cargo.toml linguist-generated
16+
Cargo.lock linguist-generated
17+
18+
# Node.js bindings
19+
bindings/node/* linguist-generated
20+
binding.gyp linguist-generated
21+
package.json linguist-generated
22+
package-lock.json linguist-generated
23+
24+
# Python bindings
25+
bindings/python/** linguist-generated
26+
setup.py linguist-generated
27+
pyproject.toml linguist-generated
28+
29+
# Go bindings
30+
bindings/go/* linguist-generated
31+
go.mod linguist-generated
32+
go.sum linguist-generated
33+
34+
# Swift bindings
35+
bindings/swift/** linguist-generated
36+
Package.swift linguist-generated
37+
Package.resolved linguist-generated

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,22 @@ jobs:
3030
matrix:
3131
os: [ubuntu-latest, windows-latest, macos-14]
3232
steps:
33-
- name: Set up repository
34-
uses: tree-sitter/parser-setup-action@v1.1
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
3535
with:
3636
submodules: true
37-
node-version: ${{vars.NODE_VERSION}}
38-
- name: Run tests
39-
uses: tree-sitter/parser-test-action@v1.2
37+
- name: Set up tree-sitter
38+
uses: tree-sitter/setup-action/cli@v1
39+
- name: Run parser and binding tests
40+
uses: tree-sitter/parser-test-action@v2
41+
- name: Parse sample files
42+
uses: tree-sitter/parse-action@v4
43+
id: parse-files
4044
with:
41-
test-library: ${{runner.os == 'Linux'}}
42-
corpus-files: templates/**/*.gitattributes
45+
files: templates/**/*.gitattributes
46+
- name: Upload failures artifact
47+
uses: actions/upload-artifact@v4
48+
if: "!cancelled() && steps.parse-files.outcome == 'failure'"
49+
with:
50+
name: failures-${{runner.os}}
51+
path: ${{steps.parse-files.outputs.failures}}

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags: ["*"]
66

77
jobs:
8+
release:
9+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
10+
permissions:
11+
contents: write
812
npm:
913
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
1014
secrets:

.gitignore

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
1-
node_modules/
2-
yarn.lock
3-
Cargo.lock
1+
# Rust artifacts
2+
target/
43

4+
# Node artifacts
55
build/
6-
target/
6+
prebuilds/
7+
node_modules/
8+
9+
# Swift artifacts
10+
.build/
11+
12+
# Go artifacts
13+
_obj/
14+
15+
# Python artifacts
16+
.venv/
17+
dist/
18+
*.egg-info
19+
*.whl
20+
21+
# C artifacts
22+
*.a
23+
*.so
24+
*.so.*
25+
*.dylib
26+
*.dll
27+
*.pc
28+
29+
# Example dirs
30+
/examples/*/
31+
32+
# Grammar volatiles
733
*.wasm
34+
*.obj
835
*.o
36+
37+
# Archives
38+
*.tar.gz
39+
*.tgz
40+
*.zip

CMakeLists.txt

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.lock

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)