Skip to content

Commit

Permalink
chore: merge with upstream master (#2)
Browse files Browse the repository at this point in the history
* Parse text blocks which may contain " (double quotes)

* Update the versions of the repositories used for `script/parse-examples`

* feat: make escape sequences distinguishable, fix multiline strings

* chore: update tests

* feat(queries): escape_sequence = @string.escape

* chore: generate

* feat: add test for escape sequences

* Remove deprecated actions

* fix, Remove obsolete "text_block"

This seems to be a leftover of tree-sitter#137.

Fixes tree-sitter#141

* fix, Local variable declaration with generic types and scoped type identifier

This change partially reverts a change from tree-sitter#125 which caused the regression.
The test case introduced by tree-sitter#125 still exists and works.

Fixes tree-sitter#138

* Create CMakeLists.txt for Windows builds

create a cmake config to enable building this as lib for Visual Studio buildchain

* Introduce condition expression for capturing the conditions for if_statement and while_statement

* Check-in generated files

* Add test

* ci: bump action & node versions

* fix: rework decimal logic to properly parse octal numbers

* fix: make cast expression values with ampersands stricter

Fixes issues where a binary bitwise expression could be interpreted as a cast expression

* chore: generate

* chore: tidy up Rust bindings

* ci: add certain branch requirements for CI to run

* Prevent mangled URL in .pc file

Previously, the `Makefile` assumed that Git URLs were always “SSH style”, e.g., `git@github.com:tree-sitter/tree-sitter-java.git`.  This change causes the right thing to be done when a normal URL is encountered, e.g. `https://github.com/tree-sitter/tree-sitter-java.git`.

Relates to https://bugzilla.redhat.com/show_bug.cgi?id=2193261

* feat: add `record` as a keyword to highlights

* fix: add more allowed reserved identifiers & allow them in annotation type element names

* feat: add patterns

* fix: repeated "field identifiers" can come before this in a receiver parameter

* fix: allow annotations after new but before the type, add cent unicode to identifiers

* chore: generate

* add string interpolations

* add switch pattern matching changes

* add back generated code

* feat: add unnamed patterns

* allow toplevel method declarations

* fix: a receiver parameter can be followed by more parameters

* fix: annotations following type arguments

* fix: escaped quote immediately before triple quote

* fix: double-backslash escapes

* fix: allow semicolons in annotation_type_declaration

* chore: generate

* Update workflow to publish crate, NPM package, and create GitHub release

* Bump version to 0.20.2

* docs: update badges

* fix: unescaped curly brace in regex and invert query precedence for test

* fix(test): remove leading space

* refactor: remove condition rule

* fix: tweak escape sequence and identifier rules

* chore: generate

* build: update bindings and versions

* ci: update workflows

* fix: add support for whitespace

* make whitespace nodes namedd

* Parse text blocks which may contain " (double quotes)

* Update the versions of the repositories used for `script/parse-examples`

* feat: make escape sequences distinguishable, fix multiline strings

* chore: update tests

* feat(queries): escape_sequence = @string.escape

* chore: generate

* feat: add test for escape sequences

* fix, Remove obsolete "text_block"

This seems to be a leftover of tree-sitter#137.

Fixes tree-sitter#141

* fix, Local variable declaration with generic types and scoped type identifier

This change partially reverts a change from tree-sitter#125 which caused the regression.
The test case introduced by tree-sitter#125 still exists and works.

Fixes tree-sitter#138

* Remove deprecated actions

* Create CMakeLists.txt for Windows builds

create a cmake config to enable building this as lib for Visual Studio buildchain

* Introduce condition expression for capturing the conditions for if_statement and while_statement

* Check-in generated files

* Add test

* ci: bump action & node versions

* fix: rework decimal logic to properly parse octal numbers

* fix: make cast expression values with ampersands stricter

Fixes issues where a binary bitwise expression could be interpreted as a cast expression

* chore: generate

* chore: tidy up Rust bindings

* ci: add certain branch requirements for CI to run

* Prevent mangled URL in .pc file

Previously, the `Makefile` assumed that Git URLs were always “SSH style”, e.g., `git@github.com:tree-sitter/tree-sitter-java.git`.  This change causes the right thing to be done when a normal URL is encountered, e.g. `https://github.com/tree-sitter/tree-sitter-java.git`.

Relates to https://bugzilla.redhat.com/show_bug.cgi?id=2193261

* feat: add `record` as a keyword to highlights

* fix: add more allowed reserved identifiers & allow them in annotation type element names

* feat: add patterns

* fix: repeated "field identifiers" can come before this in a receiver parameter

* fix: allow annotations after new but before the type, add cent unicode to identifiers

* chore: generate

* add string interpolations

* add switch pattern matching changes

* add back generated code

* feat: add unnamed patterns

* allow toplevel method declarations

* fix: a receiver parameter can be followed by more parameters

* fix: annotations following type arguments

* fix: escaped quote immediately before triple quote

* fix: double-backslash escapes

* fix: allow semicolons in annotation_type_declaration

* chore: generate

* Update workflow to publish crate, NPM package, and create GitHub release

* Bump version to 0.20.2

* docs: update badges

* fix: unescaped curly brace in regex and invert query precedence for test

* fix(test): remove leading space

* refactor: remove condition rule

* fix: tweak escape sequence and identifier rules

* chore: generate

* build: update bindings and versions

* ci: update workflows

* fix: add support for whitespace

* make whitespace nodes namedd

* update parser

* remove space pattern

---------

Co-authored-by: Bruno Mahé <bruno@bmahe.net>
Co-authored-by: Yoann Padioleau <yoann.padioleau@gmail.com>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
Co-authored-by: Luni-4 <luni-4@hotmail.it>
Co-authored-by: Andreas Humenberger <andreas.humenberger@symflower.com>
Co-authored-by: Gheorghi <larodi@gmail.com>
Co-authored-by: Ameya Ketkar <94497232+ketkarameya@users.noreply.github.com>
Co-authored-by: Amaan Qureshi <amaanq@Amaans-MacBook-Air.local>
Co-authored-by: Peter Oliver <git@mavit.org.uk>
Co-authored-by: Wilfred Hughes <me@wilfred.me.uk>
Co-authored-by: brandonspark <wu.brandonj@gmail.com>
Co-authored-by: Hendrik van Antwerpen <hendrikvanantwerpen@github.com>
Co-authored-by: Hendrik van Antwerpen <hendrik@van-antwerpen.net>
Co-authored-by: Will Lillis <wlillis@umass.edu>
Co-authored-by: Raghav Shankar <raghav@deepsource.io>
  • Loading branch information
16 people authored May 6, 2024
1 parent 8a44af6 commit 055463a
Show file tree
Hide file tree
Showing 61 changed files with 69,666 additions and 54,390 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8
13 changes: 11 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
/src/** linguist-vendored
/examples/* linguist-vendored
* text eol=lf

src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
9 changes: 0 additions & 9 deletions .github/pull_request_template.md

This file was deleted.

67 changes: 49 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,59 @@
name: Build/test
name: CI

on:
pull_request:
push:
branches: [master]
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
pull_request:
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Set up examples
run: |-
git clone https://github.com/elastic/elasticsearch examples/elasticsearch --single-branch --depth=1 --filter=blob:none
git clone https://github.com/google/guava examples/guava --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ReactiveX/RxJava examples/RxJava --single-branch --depth=1 --filter=blob:none
git clone https://github.com/apache/flink examples/flink --single-branch --depth=1 --filter=blob:none
git clone https://github.com/apache/logging-log4j2 examples/log4j2 --single-branch --depth=1 --filter=blob:none
git clone https://github.com/apache/cassandra examples/cassandra --single-branch --depth=1 --filter=blob:none
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
node-version: 16
- run: npm install
- run: npm test
test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
test-rust: ${{runner.os == 'Linux'}}
- name: Parse examples
id: examples
continue-on-error: true
uses: tree-sitter/parse-action@v4
with:
files: examples/**/*.java
- uses: actions/upload-artifact@v4
if: steps.examples.outputs.failures != ''
with:
node-version: 16
- run: npm install
- run: npm run-script test-windows
name: failures-${{matrix.os}}
path: ${{steps.examples.outputs.failures}}
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
push:
branches: [master]
paths:
- grammar.js
pull_request:
paths:
- grammar.js

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install modules
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish packages

on:
push:
tags: ["*"]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
36 changes: 0 additions & 36 deletions .github/workflows/publish_crate.yml

This file was deleted.

48 changes: 34 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
# Rust artifacts
Cargo.lock
node_modules
build
*.log
package-lock.json
script/javaparser-test/target
test.java
/examples/elasticsearch
/examples/guava
/examples/RxJava
/target/
target/

# Node artifacts
build/
prebuilds/
node_modules/
*.tgz

# Swift artifacts
.build/

# Go artifacts
go.sum
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.dylib
*.so
*.so.*
*.dylib
*.dll
*.pc

# Example dirs
/examples/*/

# Grammar volatiles
*.wasm
*.obj
*.o
bindings/c/*.h
bindings/c/tree-sitter-*.pc
.build/
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

68 changes: 0 additions & 68 deletions CONTRIBUTING.md

This file was deleted.

Loading

0 comments on commit 055463a

Please sign in to comment.