Skip to content

Commit 768913a

Browse files
committed
2 parents ad51e52 + d9219ad commit 768913a

Some content is hidden

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

57 files changed

+17323
-2508
lines changed

.appveyor.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.editorconfig

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
[*.{json,toml,yml,gyp}]
7+
indent_style = space
8+
indent_size = 2
9+
10+
[*.js]
11+
indent_style = space
12+
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]
31+
indent_style = space
32+
indent_size = 4
33+
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: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
/src/parser.c linguist-vendored
1+
* text=auto eol=lf
2+
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
15+
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/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
- src/**
9+
- test/**
10+
- bindings/**
11+
- binding.gyp
12+
pull_request:
13+
paths:
14+
- grammar.js
15+
- src/**
16+
- test/**
17+
- bindings/**
18+
- binding.gyp
19+
20+
concurrency:
21+
group: ${{github.workflow}}-${{github.ref}}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
test:
26+
name: Test parser
27+
runs-on: ${{matrix.os}}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ubuntu-latest, windows-latest, macos-14]
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- name: Set up tree-sitter
36+
uses: tree-sitter/setup-action/cli@v2
37+
- name: Run tests
38+
uses: tree-sitter/parser-test-action@v2
39+
with:
40+
test-rust: true
41+
test-node: true
42+
test-python: true
43+
test-go: true
44+
test-swift: true
45+
- name: Parse examples
46+
uses: tree-sitter/parse-action@v4
47+
with:
48+
files: examples/*

.github/workflows/fuzz.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Fuzz parser
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- src/scanner.c
8+
pull_request:
9+
paths:
10+
- src/scanner.c
11+
12+
jobs:
13+
fuzz:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Run fuzzer
19+
uses: tree-sitter/fuzz-action@v4

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
pull_request:
9+
paths:
10+
- grammar.js
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: npm
22+
node-version: ${{vars.NODE_VERSION}}
23+
- name: Install modules
24+
run: npm ci --legacy-peer-deps
25+
- name: Run ESLint
26+
run: npm run lint

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
attestations: write
11+
12+
jobs:
13+
github:
14+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
15+
with:
16+
generate: true
17+
attestations: true
18+
npm:
19+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
20+
secrets:
21+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22+
with:
23+
generate: true
24+
crates:
25+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
26+
secrets:
27+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
28+
with:
29+
generate: true
30+
pypi:
31+
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
32+
secrets:
33+
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
34+
with:
35+
generate: true

.gitignore

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
1-
node_modules
2-
build
3-
*.log
4-
package-lock.json
5-
target
6-
Cargo.lock
1+
# Rust artifacts
2+
target/
3+
4+
# Node artifacts
5+
build/
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
722
*.a
8-
*.dylib
923
*.so
24+
*.so.*
25+
*.dylib
26+
*.dll
27+
*.pc
28+
29+
# Example dirs
30+
/examples/*/
31+
32+
# Grammar volatiles
33+
*.wasm
34+
*.obj
1035
*.o
11-
bindings/c/*.h
12-
bindings/c/*.pc
13-
yarn.lock
36+
37+
# Archives
38+
*.tar.gz
39+
*.tgz
40+
*.zip

.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)