Skip to content

Merge upstream #15

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

Draft
wants to merge 106 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
692f98c
:arrow_up: update node ci version
JoranHonig Feb 26, 2024
2da2ee1
:arrow_up: update node version in ci
JoranHonig Feb 26, 2024
5c3cb87
:recycle: remove unnecessary conflicts
JoranHonig Feb 26, 2024
82c8899
:arrow_up: update tree-sitter dependencies
JoranHonig Feb 26, 2024
e49a18d
regenerate code
JoranHonig Feb 26, 2024
56d351c
:bug: fix confusion between type cast and call
JoranHonig Feb 26, 2024
f5180df
✨ Add support for assembly flags
Philogy Dec 25, 2023
7e90a4a
:recycle: make assembly flags public
JoranHonig Feb 26, 2024
eac62e9
:sparkles: add test for assembly flags
JoranHonig Feb 26, 2024
2bd3c6a
regenerate parser
JoranHonig Feb 26, 2024
5cb506a
Merge pull request #47 from JoranHonig/feature/assembly_flags
JoranHonig Feb 26, 2024
c433a87
fix: typo in event_parameter
beeb Mar 11, 2024
e62d18f
feat: add body to struct declaration
beeb Mar 11, 2024
fb92578
feat: add body in enum declaration
beeb Mar 11, 2024
fd3f380
fix: no need for comment in struct body
beeb Mar 11, 2024
b239a95
:bug: fix broken regex
JoranHonig Mar 12, 2024
f002cf4
Merge branch 'master' into fix/typo
beeb Mar 12, 2024
76f17f4
Merge branch 'master' into feature/struct-enum-body
beeb Mar 12, 2024
9fffa1e
test: fix enum and struct tests
beeb Mar 16, 2024
a284d40
:sparkles: add key & value identifiers to mapping type
JoranHonig Apr 2, 2024
1f7a0ea
Merge pull request #54 from JoranHonig/fix/recursive-mapping
JoranHonig Apr 2, 2024
1da0f03
implement field unchecked
JoranHonig Apr 2, 2024
a90e67f
Merge pull request #55 from JoranHonig/fix/unchecked
JoranHonig Apr 2, 2024
d8baab4
add more entries to npmignore
JoranHonig Apr 2, 2024
0c77af6
bump version
JoranHonig Apr 2, 2024
edde82a
update parser
JoranHonig Apr 2, 2024
c8ee03b
v1.2.2
JoranHonig Apr 2, 2024
a8ed2f5
update cargo version
JoranHonig Apr 2, 2024
d4abca2
:bug: fix misplaced bracket in enum test
JoranHonig Apr 9, 2024
134cdce
compile
JoranHonig Apr 9, 2024
f9d08a7
Merge remote-tracking branch 'origin/master' into pr_amend/50
JoranHonig Apr 9, 2024
78fa942
Merge pull request #56 from JoranHonig/pr_amend/50
JoranHonig Apr 9, 2024
3a0ba6c
chore: merge branch 'master' into fix/typo
beeb Apr 9, 2024
bbf2cc8
Merge pull request #49 from beeb/fix/typo
JoranHonig Apr 9, 2024
5a5f9ec
run generate to compile parser
JoranHonig Apr 9, 2024
7c1229f
run new generator
JoranHonig Apr 9, 2024
08338dc
Merge pull request #57 from JoranHonig/feat/new-generate
JoranHonig Apr 9, 2024
9a7c38c
:construction_worker: implement publish node package on ci
JoranHonig Apr 13, 2024
cfcb06b
:construction_worker: implement publish rust crate on CI
JoranHonig Apr 13, 2024
31ce6a0
make expression nodes public
JoranHonig Apr 13, 2024
98017d7
update tests with public nodes
JoranHonig Apr 13, 2024
41ec84e
fix queries with public expression node
JoranHonig Apr 13, 2024
5584070
Merge pull request #58 from JoranHonig/feat/public-nodes
JoranHonig Apr 13, 2024
09e222e
version bump
JoranHonig Apr 13, 2024
1653da0
generate
JoranHonig Apr 13, 2024
c3da7d9
generate
JoranHonig Apr 13, 2024
39ed417
update tree-sitter rust dependency
JoranHonig Apr 30, 2024
fa5c61c
fix broken queries
JoranHonig Apr 30, 2024
3673882
bump cargo version
JoranHonig Apr 30, 2024
b5a23ea
:sparkles: add named node for binary operators
JoranHonig May 1, 2024
47c64a7
:launch: new rust pkg version
JoranHonig May 1, 2024
2e49e1b
feat: file level events
meetmangukiya May 13, 2024
44b08c6
add file level event test
meetmangukiya May 15, 2024
ec244c1
update tests for binary operators
JoranHonig May 26, 2024
4ac2357
generate grammar
JoranHonig May 26, 2024
f19e51e
update queries
JoranHonig May 26, 2024
bb03e2f
update bindings new tree-sitter version
JoranHonig May 26, 2024
22ff9a1
Merge pull request #60 from parmanuxyz/file-level-evnts
JoranHonig May 26, 2024
46d266b
build parser
JoranHonig May 26, 2024
44b8859
feat(solidity): cancun support
JoranHonig May 26, 2024
2243dd9
Merge pull request #61 from JoranHonig/pr/cancun
JoranHonig May 26, 2024
287c7d5
update operator to private node
JoranHonig May 26, 2024
b320ebb
fix queries
JoranHonig May 26, 2024
65d0cc6
generate parser
JoranHonig May 26, 2024
7b3e9f8
Merge branch 'master' of github.com:JoranHonig/tree-sitter-solidity
JoranHonig May 26, 2024
e8bd851
generate parser
JoranHonig May 26, 2024
0eb048d
check if current nvim queries still work
JoranHonig May 26, 2024
70548e6
fix ci
JoranHonig May 26, 2024
8d29e7e
ci: use working directory in ci step
JoranHonig May 26, 2024
8f23962
ci: only pass test if the generated files are all up to date
JoranHonig May 26, 2024
520f04a
ci: adopt tree-sitter publish action
JoranHonig May 26, 2024
2819e5e
bump version
JoranHonig May 26, 2024
82c25a1
add package lock
JoranHonig May 26, 2024
2c5f1e7
update cli version
JoranHonig May 26, 2024
0e86ae6
ci: set node version
JoranHonig May 27, 2024
1c94fe3
ci: use with syntax
JoranHonig May 27, 2024
167ed4b
make statement public node
JoranHonig Jun 12, 2024
0a88f24
downgrade tree-sitter cargo version to maintain compatibility with tr…
JoranHonig Jun 12, 2024
417f31e
fix: rust tests
JoranHonig Jun 12, 2024
ee5a2d2
bump version
JoranHonig Jun 12, 2024
bd4757c
fix: align operator precedence with Solidity documentation
elopez Sep 8, 2024
e013724
fix: adjust test code
elopez Sep 8, 2024
c93b862
test: add new precedence tests
elopez Sep 8, 2024
1560874
`tree-sitter generate`
elopez Sep 8, 2024
f3c5a6b
regenerate
JoranHonig Nov 27, 2024
7f3022c
remove spurious operator from highlights
JoranHonig Nov 27, 2024
509eb7b
update cli version
JoranHonig Nov 27, 2024
8d54d60
Merge pull request #64 from JoranHonig/pr/fix/precedence
JoranHonig Nov 27, 2024
386a820
add transient location to variable declariation
JoranHonig Nov 27, 2024
ae91a07
generate
JoranHonig Nov 27, 2024
8703c7f
Merge pull request #65 from JoranHonig/feature/solidity_language_updates
JoranHonig Nov 27, 2024
7f9f8cc
version bump to v1.2.9
JoranHonig Nov 27, 2024
bf26872
Merge branch 'master' of github.com:JoranHonig/tree-sitter-solidity
JoranHonig Nov 27, 2024
b1593be
feat: use tree sitter language instead of tree sitter package
JoranHonig Dec 13, 2024
e911165
regenerate
JoranHonig Dec 13, 2024
f7f5251
publish: new version with updated dependencies
JoranHonig Dec 13, 2024
74ca52d
fix: remove node.js from gitignore
JoranHonig Jan 20, 2025
0cea7b1
fix: re-add index.js
JoranHonig Jan 20, 2025
e45a52c
bump version
JoranHonig Jan 20, 2025
effd3f5
monitor helix query compatibility
JoranHonig Jan 20, 2025
7270875
fix: use the correct helix repo
JoranHonig Jan 20, 2025
156fdfa
set version for python package
JoranHonig Jan 29, 2025
d0a5f61
fix: homepage url
JoranHonig Jan 29, 2025
80dfada
add pypi publishing workflow
JoranHonig Jan 29, 2025
8d78fa7
add manual trigger publish workflow
JoranHonig Jan 29, 2025
d38dcd0
chore: update python pkg files based on upstream changes
JoranHonig Jan 29, 2025
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
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
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* 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
35 changes: 35 additions & 0 deletions .github/workflows/helix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: check against helix tree-sitter queries

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install yarn -g
npm install tree-sitter-cli -g
- name: Generate tree-sitter parser
run: tree-sitter generate
- name: pull queries from helix
working-directory: ./queries
run: |
wget "https://raw.githubusercontent.com/helix-editor/helix/refs/heads/master/runtime/queries/solidity/highlights.scm"
wget "https://raw.githubusercontent.com/helix-editor/helix/refs/heads/master/runtime/queries/solidity/locals.scm"
wget "https://raw.githubusercontent.com/helix-editor/helix/refs/heads/master/runtime/queries/solidity/textobjects.scm"
- run: yarn
- run: yarn test
34 changes: 34 additions & 0 deletions .github/workflows/nvim-treesitter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: nvim-treesitter queries

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install yarn -g
npm install tree-sitter-cli -g
- name: Generate tree-sitter parser
run: tree-sitter generate
- name: pull queries from nvim-treesitter
working-directory: ./queries
run: |
wget "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/master/queries/solidity/highlights.scm"
wget "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/master/queries/solidity/folds.scm"
- run: yarn
- run: yarn test
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🚢 Publish package

on:
workflow_dispatch:
push:
tags: ["*"]

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

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
with:
node-version: v20.11.1
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: 📥 Setup node
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 18

- name: 📥 Install js dependencies
run: |
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/node.js.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Test grammar

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,8 +27,13 @@ jobs:
- name: Install dependencies
run: |
npm install yarn -g
npm install tree-sitter-cli -g
npm install tree-sitter-cli -g

- name: Generate tree-sitter parser
run: tree-sitter generate

- name: Generated files are up to date
run: git diff --quiet && git diff --cached --quiet

- run: yarn
- run: yarn test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
node_modules/

.vscode/
index.js

# Rust
Cargo.lock
target
build
build
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
corpus
examples
script
test

# Other compilation artefacts
build

# Rust
target
Cargo.lock
Cargo.toml

# python
typed-libraries
binding.gyp

# Js
node_modules
Expand Down
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-solidity"
description = "Solidity grammar for the tree-sitter parsing library"
version = "0.0.3"
version = "1.2.11"
keywords = ["incremental", "parsing", "Solidity"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/JoranHonig/tree-sitter-solidity"
Expand All @@ -20,7 +20,10 @@ include = [
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "0.19.5"
tree-sitter-language = "0.1"

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

[dev-dependencies]
tree-sitter = "0.24"
110 changes: 110 additions & 0 deletions Makefile

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

Loading