Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update bindings #422

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ root = true

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

[*.{json,toml,yml,gyp}]
indent_style = space
Expand All @@ -14,11 +11,11 @@ indent_size = 2
indent_style = space
indent_size = 2

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

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

Expand All @@ -37,3 +34,6 @@ indent_size = 8
[Makefile]
indent_style = tab
indent_size = 8

[parser.c]
indent_size = 2
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=auto 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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
shell: bash
run: |
npm install
npm run build
npm test
- name: Check fidelity of checked-in C code
Expand Down Expand Up @@ -112,11 +111,11 @@ jobs:
id: verify-changed-files
with:
files: |
queries/scala/*.scm
queries/*.scm
- name: Test quries if out of sync with nvim-treesitter
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter"
git diff queries/scala/
git diff queries/
npm run test
24 changes: 10 additions & 14 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
name: Fuzz parser
name: Fuzz Parser

# Run this workflow on changes to the external scanner
on:
workflow_dispatch:
push:
branches: [master]
paths:
- src/scanner.c
- src/stack.h
- src/scanner.c
pull_request:
paths:
- src/scanner.c
- src/stack.h
- src/scanner.c

jobs:
test:
name: Parser fuzzing
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: vigoux/tree-sitter-fuzz-action@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
with:
language: scala
external-scanner: src/scanner.c
time: 60
tree-sitter-version: v0.22.2
23 changes: 10 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish package
name: Publish packages

on:
push:
Expand All @@ -10,17 +10,14 @@ concurrency:

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@66df2de139d7a77a89644f67a88c803d4a8cf67e
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# TODO: comment this out for now since we publish the crate manually
# crates:
# uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
# secrets:
# CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}

# TODO: uncomment when it works
# pypi:
# uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
# secrets:
# PYPI_API_TOKEN: ${{secrets.PYPI_API_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}}
52 changes: 37 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
node_modules
build
/.build
target
*.log
test.scala
Cargo.lock
.scalafmt.conf
*worksheet.sc
*.out
.direnv
.metals
report-*
./scala
./dotty
# Rust artifacts
target/

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

# Swift artifacts
.build/
Package.resolved

# Go artifacts
_obj/

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

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

# Example dirs
/examples/*/

# Grammar volatiles
*.wasm
*.obj
*.o
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

89 changes: 89 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
[package]
name = "tree-sitter-scala"
description = "scala grammar for the tree-sitter parsing library"
description = "Scala grammar for tree-sitter"
version = "0.22.1"
keywords = ["incremental", "parsing", "scala"]
license = "MIT"
keywords = ["incremental", "parsing", "tree-sitter", "scala"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-scala"
edition = "2021"
license = "MIT"
autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.22.6"
tree-sitter-language = "0.1.0"

[build-dependencies]
cc = "1.0"
cc = "1.1.15"

[dev-dependencies]
tree-sitter = "0.23"
30 changes: 16 additions & 14 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading