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

update scala treesitter #659

Merged
merged 128 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
21cd33b
chore: generate and sync from dd02e510e92e057bdcadc4def1a3b28bed5fbea3
web-flow Jun 13, 2023
3c5e57a
Merge pull request #307 from tree-sitter/generation
ckipp01 Jun 13, 2023
662a3e9
Closes #260
Jun 14, 2023
e0d5372
Merge pull request #308 from G1ng3r/fix/implicit-arg-lambda-expr
susliko Jun 14, 2023
c714ed3
chore: generate and sync from e0d5372a203b7c2e95cb34e43124a3a819940bae
web-flow Jun 15, 2023
a5c4c29
Merge pull request #309 from tree-sitter/generation
ckipp01 Jun 15, 2023
2db4418
Add type lambda rule and related tests
KaranAhlawat Jun 21, 2023
61aa653
correct result_type to return_type
KaranAhlawat Jun 21, 2023
4f39984
Merge pull request #312 from KaranAhlawat/type-lambdas
ckipp01 Jun 21, 2023
babe7c2
chore: generate and sync from 4f399842e9622ada5b68799af99ed06d0d827e1d
web-flow Jun 22, 2023
cda0de8
Merge pull request #314 from tree-sitter/generation
ckipp01 Jun 22, 2023
b7a63ca
Add "conditional" to `case` in `indented_cases`
natsukagami Jun 30, 2023
65fdb17
Use match? instead of lua-match? for queries
natsukagami Jun 30, 2023
25f8fdf
Change wrong scala3 test
natsukagami Jun 30, 2023
263ce72
Merge pull request #321 from natsukagami/use-match
susliko Jun 30, 2023
8062487
Merge pull request #320 from natsukagami/patch-1
susliko Jun 30, 2023
aa59077
Fix interpolated string identifiers
johannescoetzee Jul 19, 2023
3aa8670
Fix double dollar escapes
johannescoetzee Jul 20, 2023
f1c0764
Remove unnecessary highlighting queries
johannescoetzee Jul 20, 2023
dda875e
Rename interpolation_identifier
johannescoetzee Jul 20, 2023
f894d1d
Add highlighting test
johannescoetzee Jul 20, 2023
9e30051
Alias interpolation_identifier to identifier to avoid query badness
johannescoetzee Jul 20, 2023
6f9683b
Handle quote dollar escape case as well
johannescoetzee Jul 21, 2023
8cdd8bd
Merge pull request #324 from johannescoetzee/fix/string-interpolation
eed3si9n Jul 23, 2023
7afd059
Scala 2 macros
eed3si9n Jul 23, 2023
ebe8596
chore: generate and sync from 8cdd8bdd7fce1bb9f0c0f7cb4a5d5aadfaccfde5
web-flow Jul 24, 2023
c7b110d
Merge pull request #326 from tree-sitter/generation
eed3si9n Jul 24, 2023
8137adb
Merge pull request #325 from eed3si9n/wip/macros
ckipp01 Jul 24, 2023
ac08834
chore: generate and sync from 8137adbfbaa9a13568fde6c2b65c28cd3f9cb23f
web-flow Jul 24, 2023
a2f36c2
Merge pull request #327 from tree-sitter/generation
ckipp01 Jul 24, 2023
c14e2d4
feat: `given` pattern
susliko Aug 7, 2023
8850174
Bump DOTTY_COMPILER_EXPECTED to 84
susliko Aug 8, 2023
3f75f62
Merge pull request #330 from susliko/given-in-for
ckipp01 Aug 8, 2023
46e0844
Allow `$.stable_type_identifier` in `derives_clause` (#331)
susliko Aug 8, 2023
ce7e098
Allow return types on new lines in definitions
susliko Aug 8, 2023
991180f
chore: generate and sync from 46e08442cd40fb33742594278a5554104cebcb31
web-flow Aug 9, 2023
b20f133
Merge pull request #334 from tree-sitter/generation
ckipp01 Aug 9, 2023
f086fb0
Merge pull request #333 from susliko/newline-before-return-type
ckipp01 Aug 9, 2023
efae10f
chore: generate and sync from f086fb0c9caf40e9e8f00704fb1de43ccd22ef7a
web-flow Aug 9, 2023
f14629b
Merge pull request #335 from tree-sitter/generation
ckipp01 Aug 9, 2023
2d6795c
Use indentable_expression in given def
Masynchin Aug 16, 2023
e76f53d
Update definitions trees
Masynchin Aug 16, 2023
5d1a186
Merge pull request #338 from Masynchin/master
eed3si9n Aug 16, 2023
8c69db2
chore: generate and sync from 5d1a186079a0a2f3f9c52a57c486da9dbd96e5b7
web-flow Aug 17, 2023
3a67773
Merge pull request #339 from tree-sitter/generation
ckipp01 Aug 17, 2023
dffe55e
fix(scanner): compiler warnings, lints, mark helper functions static …
amaanq Aug 18, 2023
d50b6ca
Merge pull request #340 from tree-sitter/scanner-and-generate
amaanq Aug 20, 2023
d72cdd4
Fixes anonymous givens
eed3si9n Aug 27, 2023
3c42764
Reduce the Dotty percentage to 83
eed3si9n Aug 27, 2023
57f19d3
Merge pull request #341 from eed3si9n/wip/anonymous_given
ckipp01 Sep 1, 2023
1c82628
chore: generate and sync from 57f19d39a5a898f43ff7aa15e1bfc6be1d59058a
web-flow Sep 1, 2023
70afdd5
Merge pull request #343 from tree-sitter/generation
ckipp01 Sep 1, 2023
f8d3848
Fix parenthesized expressions in braceless `if` conditions
susliko Sep 16, 2023
5c54434
Bump dotty codebase smoke test to 84
susliko Sep 18, 2023
2764292
Fix `derives` clause on a new line
susliko Sep 18, 2023
6ada5ca
Raise syntax complexity ceiling to 1400
susliko Sep 18, 2023
3054b9b
Derives clause for traits
susliko Sep 18, 2023
28666b1
Wildcards in tuple bindings
susliko Sep 18, 2023
0692d04
Merge pull request #354 from susliko/wildcard-bindings
eed3si9n Sep 19, 2023
c13de90
Merge branch 'master' into fix-parenthesized-expr-in-braceless-if
eed3si9n Sep 19, 2023
045ce59
Merge pull request #350 from susliko/fix-parenthesized-expr-in-bracel…
eed3si9n Sep 19, 2023
ee2e9ab
Merge branch 'master' into next-line-derives
eed3si9n Sep 19, 2023
ef639d4
chore: generate and sync from 045ce59575a044ca60ee5d86bee4d5d2778264ac
web-flow Sep 19, 2023
80fe560
Merge pull request #355 from tree-sitter/generation
eed3si9n Sep 19, 2023
5fa09e9
Merge pull request #353 from susliko/trait-derives
eed3si9n Sep 19, 2023
27a40cf
Merge pull request #352 from susliko/next-line-derives
eed3si9n Sep 19, 2023
4f761f0
chore: generate and sync from 27a40cf3cd7557be26d1a8ba27ab0f2bd332ebed
web-flow Sep 19, 2023
59ab070
Merge pull request #356 from tree-sitter/generation
ckipp01 Sep 19, 2023
cd5d3a2
Allow semicolons as only content of blocks
susliko Sep 19, 2023
fed5476
Allow semicolons before 'else'
susliko Sep 19, 2023
b80c70f
Bump dotty to 85
susliko Sep 19, 2023
8f070fe
Merge pull request #357 from susliko/better-semicolons
eed3si9n Sep 20, 2023
2b2b828
chore: generate and sync from 8f070fe470d170157d2e5fce89cea1bdbb73b894
web-flow Sep 20, 2023
aa84398
Merge pull request #362 from tree-sitter/generation
ckipp01 Sep 20, 2023
526d3b1
Support shebang.
antosha417 Sep 23, 2023
1d3a1f9
Merge pull request #363 from antosha417/shebang
susliko Sep 23, 2023
3894c16
chore: generate and sync from 1d3a1f9f18c2592a7326effb5783e6d080729a3d
web-flow Sep 24, 2023
1b4c2fa
Merge pull request #364 from tree-sitter/generation
eed3si9n Sep 25, 2023
53c4cb6
Fix crashes inside Markdown
susliko Dec 21, 2023
866f945
Merge pull request #368 from susliko/fix-crash
eed3si9n Dec 21, 2023
6c99c83
Allow infix inline modifier
susliko Dec 24, 2023
2b79741
Merge pull request #369 from susliko/infix-inline
eed3si9n Dec 26, 2023
f59a8bb
chore: generate and sync from 2b79741be78858bd65c605b6fc6e9c2641d5be50
web-flow Dec 27, 2023
696965e
Merge pull request #370 from tree-sitter/generation
susliko Dec 27, 2023
a5e34af
chore(deps): bump tj-actions/verify-changed-files in /.github/workflows
dependabot[bot] Jan 2, 2024
7891815
Merge pull request #371 from tree-sitter/dependabot/github_actions/do…
eed3si9n Jan 2, 2024
a95d787
Allow for abstract givens
susliko Jan 17, 2024
0c63ada
Merge pull request #372 from susliko/abstract-givens
susliko Jan 18, 2024
6d84c41
chore: generate and sync from 0c63ada18d34ac83eec6c7a2fba9a47e65cda48a
web-flow Jan 19, 2024
45b5ba0
Merge pull request #373 from tree-sitter/generation
ckipp01 Jan 19, 2024
f8a4c13
Allow $.function_declaration as extension body
susliko Feb 11, 2024
310f872
Merge pull request #375 from susliko/abstract-extensions
susliko Feb 11, 2024
76a563c
chore: generate and sync from 310f87253bbc467e87ccf041b1d3e8649711d2f9
web-flow Feb 12, 2024
1abd3d9
Merge pull request #376 from tree-sitter/generation
ckipp01 Feb 12, 2024
e02f003
docs: update badges
amaanq Feb 14, 2024
5e2fd33
Node 20
eed3si9n Mar 10, 2024
e702668
Update GitHub Actions
eed3si9n Mar 10, 2024
4eb5a61
windows-latest
eed3si9n Mar 11, 2024
3007ed5
Fix character literal (#383)
eed3si9n Mar 11, 2024
71ee31c
Merge pull request #381 from eed3si9n/wip/github-actions
ckipp01 Mar 11, 2024
2914b02
chore: generate and sync from 71ee31cd2157eda9c3893b0b5e7ca1123de34865
web-flow Mar 12, 2024
24fd647
Merge pull request #386 from tree-sitter/generation
eed3si9n Mar 12, 2024
97c9cff
Update tree-sitter to 0.21.0
eed3si9n Mar 10, 2024
fb4e246
Commit bindings/node changes
eed3si9n Mar 12, 2024
7dd646f
Refactor highlighting
eed3si9n Mar 11, 2024
4c7275c
Fix version numbers
eed3si9n Mar 12, 2024
e205ec8
Merge pull request #387 from eed3si9n/wip/tree-sitter-bump-0.21.0
eed3si9n Mar 12, 2024
7802a92
chore: generate and sync from e205ec827d76957ef8680e832e0d9f2c3649f4cb
web-flow Mar 12, 2024
b3ac6a5
Merge pull request #388 from tree-sitter/generation
eed3si9n Mar 12, 2024
2935d41
Fix GitHub Actions
eed3si9n Mar 13, 2024
70b4fe6
Merge pull request #390 from eed3si9n/wip/fix-fuzz
eed3si9n Mar 13, 2024
91529e9
Exclude colon, at, and equal from single opchar
eed3si9n Apr 14, 2024
16a7075
Add RefChecks.scala as differential test
eed3si9n Apr 14, 2024
d3eb6b2
Merge pull request #394 from eed3si9n/wip/op
ckipp01 Apr 15, 2024
4b10c34
chore: generate and sync from d3eb6b2382f3051cca164f4cc41cdb5bf0876e10
web-flow Apr 16, 2024
b76db43
Merge pull request #395 from tree-sitter/generation
ckipp01 Apr 16, 2024
4941073
tree-sitter 0.22.6
eed3si9n Mar 10, 2024
3080c54
Merge pull request #379 from eed3si9n/wip/tree-sitter-bump
eed3si9n Jun 22, 2024
9b739be
chore: generate and sync from 3080c54e22ff57a9319f2261cc3026b4b8e6c594
web-flow Jun 22, 2024
5bce09b
Merge pull request #400 from tree-sitter/generation
eed3si9n Jun 22, 2024
ae91190
Bump smoke test targets
eed3si9n Jun 30, 2024
de465b0
Merge pull request #401 from eed3si9n/wip/smoke
eed3si9n Jun 30, 2024
a6e8f24
Move corpus
eed3si9n Jun 30, 2024
599d12b
Merge pull request #402 from eed3si9n/wip/corpus
eed3si9n Jun 30, 2024
3fb3931
refactor(scanner): use new array header for stack
amaanq May 10, 2024
a13f2d1
Merge pull request #405 from eed3si9n/wip/array
eed3si9n Jul 17, 2024
20db428
Merge commit 'a13f2d1ee9609cc5c4c8ffce9640c353b77a24d8'
hugo-vrijswijk Jul 23, 2024
df76ea2
Update compare result
hugo-vrijswijk Jul 23, 2024
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
2 changes: 1 addition & 1 deletion sample_files/compare.expected
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ sample_files/ruby_1.rb sample_files/ruby_2.rb
d4d591902030355656f5c18c78f965a6 -

sample_files/scala_1.scala sample_files/scala_2.scala
f19e0f0ab3cabb1b5c863b78a5a6b2d2 -
446702806bab430dc50aad493d53f64f -

sample_files/scheme_1.scm sample_files/scheme_2.scm
09f8683219a8491c22d9a2fa1ce98c16 -
Expand Down
39 changes: 39 additions & 0 deletions vendored_parsers/tree-sitter-scala/.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
40 changes: 23 additions & 17 deletions vendored_parsers/tree-sitter-scala/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
- master
jobs:
changedfiles:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
all: ${{ steps.changes.outputs.all}}
c: ${{ steps.changes.outputs.c }}
gen: ${{ steps.changes.outputs.gen }}
steps:
- name: checkout tree-sitter-scala
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 10

Expand All @@ -30,42 +30,47 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, macos-latest, windows-2019]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: checkout tree-sitter-scala
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: checkout scala/scala
if: ${{ runner.os == 'Linux' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: scala/scala
ref: v2.13.10
ref: v2.13.14
path: scala_scala

- name: checkout lampepfl/dotty
- name: checkout scala/scala3
if: ${{ runner.os == 'Linux' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: lampepfl/dotty
ref: 3.3.0
repository: scala/scala3
ref: 3.5.0-RC2
path: dotty

- name: checkout lichess-org/lila
if: ${{ runner.os == 'Linux' }}
uses: actions/checkout@v4
with:
repository: lichess-org/lila
ref: 83e61b9ef617164fe1d3a5112fcc611d0e5a7ea9
path: lila

- name: checkout nvim-treesitter/nvim-treesitter
if: ${{ runner.os == 'Linux' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nvim-treesitter/nvim-treesitter
path: nvim_treesitter

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Test C stack code
run: gcc test/test-stack.c -o a.out && ./a.out
node-version: 20

- name: Generate parser from scratch and test it
if: ${{ runner.os == 'Linux' || needs.changedfiles.outputs.c }}
Expand Down Expand Up @@ -93,6 +98,7 @@ jobs:
env:
SCALA_SCALA_DIR: scala_scala
DOTTY_DIR: dotty
LILA_DIR: lila
run: script/smoke_test.sh

- name: copy nvim-treesitter queries
Expand All @@ -102,7 +108,7 @@ jobs:

- name: Check if queries are out of sync with nvim-treesitter
if: ${{ runner.os == 'Linux' }}
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v19
id: verify-changed-files
with:
files: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Parser fuzzing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: vigoux/tree-sitter-fuzz-action@v1
with:
language: scala
Expand Down
10 changes: 7 additions & 3 deletions vendored_parsers/tree-sitter-scala/.github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:

jobs:
check-and-sync:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
all: ${{ steps.changes.outputs.all}}
c: ${{ steps.changes.outputs.c }}
steps:
- name: checkout tree-sitter-scala
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 10

Expand All @@ -27,14 +27,18 @@ jobs:
npm run format

- name: Check for changes
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v19
id: verify-changed-files
with:
files: |
bindings/c/tree-sitter-scala.h
bindings/c/tree-sitter-scala.pc.in
grammar.js
src/grammar.json
src/node-types.json
src/parser.c
src/tree_sitter/alloc.h
src/tree_sitter/array.h
src/tree_sitter/parser.h

- name: Commit changes if necessary
Expand Down
6 changes: 3 additions & 3 deletions vendored_parsers/tree-sitter-scala/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "tree-sitter-scala"
description = "scala grammar for the tree-sitter parsing library"
version = "0.20.0"
version = "0.22.0"
keywords = ["incremental", "parsing", "scala"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-scala"
edition = "2018"
edition = "2021"
license = "MIT"

build = "bindings/rust/build.rs"
Expand All @@ -20,7 +20,7 @@ include = [
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.20.7"
tree-sitter = "0.22.6"

[build-dependencies]
cc = "1.0"
112 changes: 112 additions & 0 deletions vendored_parsers/tree-sitter-scala/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
VERSION := 0.0.1

LANGUAGE_NAME := tree-sitter-scala

# repository
SRC_DIR := src

PARSER_REPO_URL := $(shell git -C $(SRC_DIR) remote get-url origin 2>/dev/null)

ifeq ($(PARSER_URL),)
PARSER_URL := $(subst .git,,$(PARSER_REPO_URL))
ifeq ($(shell echo $(PARSER_URL) | grep '^[a-z][-+.0-9a-z]*://'),)
PARSER_URL := $(subst :,/,$(PARSER_URL))
PARSER_URL := $(subst git@,https://,$(PARSER_URL))
endif
endif

TS ?= tree-sitter

# ABI versioning
SONAME_MAJOR := $(word 1,$(subst ., ,$(VERSION)))
SONAME_MINOR := $(word 2,$(subst ., ,$(VERSION)))

# install directory layout
PREFIX ?= /usr/local
INCLUDEDIR ?= $(PREFIX)/include
LIBDIR ?= $(PREFIX)/lib
PCLIBDIR ?= $(LIBDIR)/pkgconfig

# source/object files
PARSER := $(SRC_DIR)/parser.c
EXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c))
OBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS))

# flags
ARFLAGS ?= rcs
override CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC

# OS-specific bits
ifeq ($(OS),Windows_NT)
$(error "Windows is not supported")
else ifeq ($(shell uname),Darwin)
SOEXT = dylib
SOEXTVER_MAJOR = $(SONAME_MAJOR).dylib
SOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).dylib
LINKSHARED := $(LINKSHARED)-dynamiclib -Wl,
ifneq ($(ADDITIONAL_LIBS),)
LINKSHARED := $(LINKSHARED)$(ADDITIONAL_LIBS),
endif
LINKSHARED := $(LINKSHARED)-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SONAME_MAJOR).dylib,-rpath,@executable_path/../Frameworks
else
SOEXT = so
SOEXTVER_MAJOR = so.$(SONAME_MAJOR)
SOEXTVER = so.$(SONAME_MAJOR).$(SONAME_MINOR)
LINKSHARED := $(LINKSHARED)-shared -Wl,
ifneq ($(ADDITIONAL_LIBS),)
LINKSHARED := $(LINKSHARED)$(ADDITIONAL_LIBS)
endif
LINKSHARED := $(LINKSHARED)-soname,lib$(LANGUAGE_NAME).so.$(SONAME_MAJOR)
endif
ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)
PCLIBDIR := $(PREFIX)/libdata/pkgconfig
endif

all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc

lib$(LANGUAGE_NAME).a: $(OBJS)
$(AR) $(ARFLAGS) $@ $^

lib$(LANGUAGE_NAME).$(SOEXT): $(OBJS)
$(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@
ifneq ($(STRIP),)
$(STRIP) $@
endif

$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in
sed -e 's|@URL@|$(PARSER_URL)|' \
-e 's|@VERSION@|$(VERSION)|' \
-e 's|@LIBDIR@|$(LIBDIR)|' \
-e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
-e 's|@REQUIRES@|$(REQUIRES)|' \
-e 's|@ADDITIONAL_LIBS@|$(ADDITIONAL_LIBS)|' \
-e 's|=$(PREFIX)|=$${prefix}|' \
-e 's|@PREFIX@|$(PREFIX)|' $< > $@

$(PARSER): $(SRC_DIR)/grammar.json
$(TS) generate --no-bindings $^

install: all
install -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)'
install -m644 bindings/c/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h
install -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
install -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a
install -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)
ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)
ln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT)

uninstall:
$(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc

clean:
$(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT)

test:
$(TS) test

.PHONY: all install uninstall clean test
13 changes: 12 additions & 1 deletion vendored_parsers/tree-sitter-scala/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# tree-sitter-scala

[![Test the grammar](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)
[![CI][ci]](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-scala)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-scala)

Scala grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
covering both Scala 2 and 3.

## References

_Scala 2_

- [The Scala 2 Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/)
- [Scala 2 Syntax Summary](https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)

Expand All @@ -19,3 +24,9 @@ _Scala 3_

Please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on
getting set up.

[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scala/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-scala?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-scala?logo=rust
14 changes: 8 additions & 6 deletions vendored_parsers/tree-sitter-scala/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
"targets": [
{
"target_name": "tree_sitter_scala_binding",
"dependencies": [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"src"
"src",
],
"sources": [
"src/parser.c",
"bindings/node/binding.cc",
"src/scanner.c"
"src/parser.c",
"src/scanner.c",
],
"cflags_c": [
"-std=c99",
]
"-std=c11",
],
}
]
}
16 changes: 16 additions & 0 deletions vendored_parsers/tree-sitter-scala/bindings/c/tree-sitter-scala.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_SCALA_H_
#define TREE_SITTER_SCALA_H_

typedef struct TSLanguage TSLanguage;

#ifdef __cplusplus
extern "C" {
#endif

const TSLanguage *tree_sitter_scala(void);

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_SCALA_H_
Loading
Loading