Skip to content

Commit 4a35151

Browse files
merged Jetbrains' master to tree-sitter's master
the Jetbrains version has not been maintained since 5 months this maintenance is directly related to upgrading jsitter to
2 parents 22be098 + 0c7b37a commit 4a35151

File tree

213 files changed

+29133
-8485
lines changed

Some content is hidden

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

213 files changed

+29133
-8485
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/lib/src/unicode/*.h linguist-vendored
2+
/lib/src/unicode/LICENSE linguist-vendored

.github/workflows/ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
CARGO_INCREMENTAL: 0
16+
EMSCRIPTEN_VERSION: 2.0.11
17+
18+
jobs:
19+
tests:
20+
name: Unix tests
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
os:
26+
- macos-latest
27+
- ubuntu-latest
28+
steps:
29+
- name: Checkout repo
30+
uses: actions/checkout@v2
31+
32+
# Work around https://github.com/actions/cache/issues/403.
33+
- name: Use GNU tar
34+
if: matrix.os == 'macos-latest'
35+
run: |
36+
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
37+
38+
- name: Cache artifacts
39+
id: cache
40+
uses: actions/cache@v2
41+
with:
42+
path: |
43+
~/.cargo/registry
44+
~/.cargo/git
45+
target
46+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-emscripten-${{ env.EMSCRIPTEN_VERSION }}
47+
48+
- name: Install rust
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
uses: actions-rs/toolchain@v1
51+
with:
52+
toolchain: stable
53+
profile: minimal
54+
55+
- name: Check Rust code formatting
56+
run: cargo fmt -- --check
57+
58+
- name: Install emscripten
59+
uses: mymindstorm/setup-emsdk@v7
60+
with:
61+
version: ${{ env.EMSCRIPTEN_VERSION }}
62+
63+
- name: Build C library
64+
run: make
65+
66+
- name: Build wasm library
67+
run: script/build-wasm
68+
69+
- name: Build CLI
70+
run: RUSTFLAGS="-D warnings" cargo build --release
71+
72+
- name: Set up fixture parsers
73+
run: |
74+
script/fetch-fixtures
75+
script/generate-fixtures
76+
script/generate-fixtures-wasm
77+
78+
- name: Run main tests
79+
run: script/test
80+
81+
- name: Run wasm tests
82+
run: script/test-wasm
83+
84+
- name: Run benchmarks
85+
run: script/benchmark
86+
87+
- name: Compress CLI binary
88+
if: startsWith(github.ref, 'refs/tags/v')
89+
run: |
90+
cp target/release/tree-sitter .
91+
export platform=$(echo ${{ runner.os }} | awk '{print tolower($0)}')
92+
gzip --suffix "-${platform}-x64.gz" tree-sitter
93+
94+
- name: Release
95+
uses: softprops/action-gh-release@v1
96+
if: startsWith(github.ref, 'refs/tags/v')
97+
with:
98+
draft: true
99+
files: |
100+
tree-sitter-*.gz
101+
lib/binding_web/tree-sitter.js
102+
lib/binding_web/tree-sitter.wasm
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ docs/assets/js/tree-sitter.js
1515
/target
1616
*.rs.bk
1717
*.a
18+
*.dylib
19+
*.so
20+
*.so.[0-9]*
1821
*.o
1922
*.obj
2023
*.exp

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/section-6-contributing.md

0 commit comments

Comments
 (0)