Skip to content

Commit 88b4235

Browse files
committed
Merge branch 'master' into reserved-words
2 parents ba0971e + a2ef079 commit 88b4235

Some content is hidden

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

69 files changed

+67787
-55701
lines changed

.editorconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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

.gitattributes

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
/src/** linguist-vendored
2-
/examples/* linguist-vendored
1+
* text=auto eol=lf
2+
3+
src/*.json linguist-generated
4+
src/parser.c linguist-generated
5+
src/tree_sitter/* linguist-generated
6+
7+
bindings/** linguist-generated
8+
binding.gyp linguist-generated
9+
setup.py linguist-generated
10+
Makefile linguist-generated
11+
CMakeLists.txt linguist-generated
12+
Package.swift linguist-generated
13+
go.mod 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/pull_request_template.md

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

.github/workflows/ci.yml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,54 @@
11
name: CI
2+
23
on:
3-
workflow_dispatch:
4-
pull_request:
54
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
623

724
jobs:
825
test:
9-
runs-on: ${{ matrix.os }}
26+
name: Test parser
27+
runs-on: ${{matrix.os}}
1028
strategy:
11-
fail-fast: true
29+
fail-fast: false
1230
matrix:
13-
os: [macos-latest, ubuntu-latest]
31+
os: [ubuntu-latest, windows-latest, macos-14]
1432
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
- name: Set up tree-sitter
36+
uses: tree-sitter/setup-action/cli@v1
37+
- name: Set up examples
38+
run: |-
39+
git config --global core.longpaths true
40+
git clone https://github.com/npm/cli examples/cli --single-branch --depth=1 --filter=blob:none
41+
- name: Run tests
42+
uses: tree-sitter/parser-test-action@v2
1743
with:
18-
node-version: 14
19-
- run: npm install
20-
- run: npm test
21-
22-
test_windows:
23-
runs-on: windows-latest
24-
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-node@v2
44+
test-rust: true
45+
test-node: true
46+
test-python: true
47+
test-go: true
48+
test-swift: true
49+
- name: Parse examples
50+
uses: tree-sitter/parse-action@v4
2751
with:
28-
node-version: 14
29-
- run: npm install
30-
- run: npm run-script test-windows
52+
files: |
53+
examples/*.js
54+
examples/*.jsx

.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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
jobs:
8+
github:
9+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
10+
npm:
11+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
12+
secrets:
13+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
14+
crates:
15+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
16+
secrets:
17+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
18+
pypi:
19+
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
20+
secrets:
21+
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}

.gitignore

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,40 @@
1-
Cargo.lock
2-
node_modules
3-
.node-version
4-
build
5-
*.log
6-
/test.js
7-
/examples/npm
8-
package-lock.json
9-
/target/
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
22+
*.a
23+
*.so
24+
*.so.*
25+
*.dylib
26+
*.dll
27+
*.pc
28+
29+
# Example dirs
30+
/examples/*/
31+
32+
# Grammar volatiles
33+
*.wasm
34+
*.obj
35+
*.o
36+
37+
# Archives
38+
*.tar.gz
39+
*.tgz
40+
*.zip

.npmignore

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

CMakeLists.txt

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

0 commit comments

Comments
 (0)