## 🌴 tree-sitter-solidity
[![Node.js CI](https://github.com/JoranHonig/tree-sitter-solidity/actions/workflows/node.js.yml/badge.svg)](https://github.com/JoranHonig/tree-sitter-solidity/actions/workflows/node.js.yml)
[![npm version](https://badge.fury.io/js/tree-sitter-solidity.svg)](https://badge.fury.io/js/tree-sitter-solidity)
> 💡 this grammar is still in development, the structure of the generated AST is not stable
This repository contains a grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
The goal of this project is to provide an parser efficient low-dependency parser for solidity which targets most solidity versions in use and is designed for enabling metaprogramming.
### Navigating this repository
The primary file in this repository is `grammar.js` which describes the tree-sitter grammar.
```
# Primary file:
grammar.js
# Tests:
/test/**/*
# Auto generated:
/src/**/*
index.js
binding.gyp
```
### References
-> Ethereum solidity grammar:
- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityParser.g4
- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityLexer.g4
- https://docs.soliditylang.org/en/latest/grammar.html?#
-> Tree-sitter javascript grammar: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/grammar.js
-> Solidity antlr grammar: https://github.com/ConsenSys/solidity-parser-antlr
Major inspriration & some structures have been taken from tree-sitter-javascript, a big thanks to the contributors to this repo!
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-solidity",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, solidity",
"author": "Joran Honig",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/cc/a7/79cac34bc3edaf21e6eac066a7f46e39db51bca57890c9b1fbac5b9c70e5/tree_sitter_solidity-1.2.11.tar.gz",
"platform": null,
"description": "## \ud83c\udf34 tree-sitter-solidity \n[![Node.js CI](https://github.com/JoranHonig/tree-sitter-solidity/actions/workflows/node.js.yml/badge.svg)](https://github.com/JoranHonig/tree-sitter-solidity/actions/workflows/node.js.yml)\n[![npm version](https://badge.fury.io/js/tree-sitter-solidity.svg)](https://badge.fury.io/js/tree-sitter-solidity)\n\n> \ud83d\udca1 this grammar is still in development, the structure of the generated AST is not stable\n\nThis repository contains a grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\nThe goal of this project is to provide an parser efficient low-dependency parser for solidity which targets most solidity versions in use and is designed for enabling metaprogramming.\n\n\n### Navigating this repository\nThe primary file in this repository is `grammar.js` which describes the tree-sitter grammar.\n\n```\n# Primary file:\ngrammar.js\n# Tests:\n/test/**/*\n\n# Auto generated:\n/src/**/*\nindex.js\nbinding.gyp\n```\n\n### References\n-> Ethereum solidity grammar: \n- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityParser.g4\n- https://github.com/ethereum/solidity/blob/develop/docs/grammar/SolidityLexer.g4\n- https://docs.soliditylang.org/en/latest/grammar.html?#\n\n-> Tree-sitter javascript grammar: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/grammar.js\n\n-> Solidity antlr grammar: https://github.com/ConsenSys/solidity-parser-antlr\n\nMajor inspriration & some structures have been taken from tree-sitter-javascript, a big thanks to the contributors to this repo! \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Solidity grammar for tree-sitter",
"version": "1.2.11",
"project_urls": {
"Homepage": "https://github.com/JoranHonig/tree-sitter-solidity"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" solidity"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ff0ec819d542d58a02e7b8030d016db0f8b26be21c78e9626aeab4472b290c0a",
"md5": "a0d7bb7ebdcf22cb4117e361387cb241",
"sha256": "0f8fa2a304299620b35df00ed56fcdcb25211c87b6e3cf35a8e7a80102729ee3"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "a0d7bb7ebdcf22cb4117e361387cb241",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 55584,
"upload_time": "2025-01-29T09:49:09",
"upload_time_iso_8601": "2025-01-29T09:49:09.301693Z",
"url": "https://files.pythonhosted.org/packages/ff/0e/c819d542d58a02e7b8030d016db0f8b26be21c78e9626aeab4472b290c0a/tree_sitter_solidity-1.2.11-cp38-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e38928a819ee9b8a8596b09701a8f07819508419994b88ef9cbb75bd24c97b24",
"md5": "5a6db441e4db2cdef136faf84fb15f1e",
"sha256": "46dfc6a989d3b42efde1f5cd141e41495e9f89b480dcad01b7719f875dd31e7e"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "5a6db441e4db2cdef136faf84fb15f1e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 57902,
"upload_time": "2025-01-29T09:49:11",
"upload_time_iso_8601": "2025-01-29T09:49:11.774438Z",
"url": "https://files.pythonhosted.org/packages/e3/89/28a819ee9b8a8596b09701a8f07819508419994b88ef9cbb75bd24c97b24/tree_sitter_solidity-1.2.11-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "285be5d1cad769756b9daeabd4f05ff30a1d18b6679ae4403f85a0e79a35b327",
"md5": "99b65465da05e3705c3f4c3fe89c61a1",
"sha256": "0478d2311fe792cb5a926859209f2042b6e108778505692c2654aaf35c61ff59"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "99b65465da05e3705c3f4c3fe89c61a1",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 90232,
"upload_time": "2025-01-29T09:49:13",
"upload_time_iso_8601": "2025-01-29T09:49:13.522090Z",
"url": "https://files.pythonhosted.org/packages/28/5b/e5d1cad769756b9daeabd4f05ff30a1d18b6679ae4403f85a0e79a35b327/tree_sitter_solidity-1.2.11-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "80cf94ba0f07b260da6b4616b558d4f0a2351d08b1d11023707711b14c8d1188",
"md5": "7a189776d7c174ef05cb06f92b38eb0d",
"sha256": "6ce8e726808dfef3aba452a6abd9f476a252555296149bd6b6bc79b9e3f271a0"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "7a189776d7c174ef05cb06f92b38eb0d",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 88092,
"upload_time": "2025-01-29T09:49:14",
"upload_time_iso_8601": "2025-01-29T09:49:14.648867Z",
"url": "https://files.pythonhosted.org/packages/80/cf/94ba0f07b260da6b4616b558d4f0a2351d08b1d11023707711b14c8d1188/tree_sitter_solidity-1.2.11-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e91c52f07e9561ad09afd29efa05a5b1ac4bb86142b28093da62a8ed84c94661",
"md5": "214aa3584dd71f9c4c24b4ea26baf868",
"sha256": "83f763768dce265a83e9ac068fa09d0e9b0ab705b8b6e321560ef9f7b174c393"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "214aa3584dd71f9c4c24b4ea26baf868",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 86820,
"upload_time": "2025-01-29T09:49:16",
"upload_time_iso_8601": "2025-01-29T09:49:16.317754Z",
"url": "https://files.pythonhosted.org/packages/e9/1c/52f07e9561ad09afd29efa05a5b1ac4bb86142b28093da62a8ed84c94661/tree_sitter_solidity-1.2.11-cp38-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c64a49999d394ed2216c753c5c617098c79fb059caac1f9eef1c08c708945fc8",
"md5": "33a104911c48e64c6627117463850745",
"sha256": "b3c831b1e425bcd3131310ac307dd2cdc4f71b806a4e39eaae5f29c24b0ef02d"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "33a104911c48e64c6627117463850745",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 64010,
"upload_time": "2025-01-29T09:49:17",
"upload_time_iso_8601": "2025-01-29T09:49:17.969418Z",
"url": "https://files.pythonhosted.org/packages/c6/4a/49999d394ed2216c753c5c617098c79fb059caac1f9eef1c08c708945fc8/tree_sitter_solidity-1.2.11-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "145358658502ab5bcc14830d65b01501628dfa6d33fdffbbc492e39fd720c0f2",
"md5": "0a3cafd98bd37c0b058f282a04228409",
"sha256": "20b0714fba7b09f882b9a5512b6fb6845ae2406ed53c173e1459a1f802cd7bb1"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11-cp38-abi3-win_arm64.whl",
"has_sig": false,
"md5_digest": "0a3cafd98bd37c0b058f282a04228409",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.9",
"size": 57726,
"upload_time": "2025-01-29T09:49:19",
"upload_time_iso_8601": "2025-01-29T09:49:19.022596Z",
"url": "https://files.pythonhosted.org/packages/14/53/58658502ab5bcc14830d65b01501628dfa6d33fdffbbc492e39fd720c0f2/tree_sitter_solidity-1.2.11-cp38-abi3-win_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cca779cac34bc3edaf21e6eac066a7f46e39db51bca57890c9b1fbac5b9c70e5",
"md5": "c2b7e04b08494e6d8a6d98c59b3ecd75",
"sha256": "1dbc0ec400c23a56af4d8441a6f0da0593433e875e963319cb0cbd19aec01b98"
},
"downloads": -1,
"filename": "tree_sitter_solidity-1.2.11.tar.gz",
"has_sig": false,
"md5_digest": "c2b7e04b08494e6d8a6d98c59b3ecd75",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 144334,
"upload_time": "2025-01-29T09:49:20",
"upload_time_iso_8601": "2025-01-29T09:49:20.200528Z",
"url": "https://files.pythonhosted.org/packages/cc/a7/79cac34bc3edaf21e6eac066a7f46e39db51bca57890c9b1fbac5b9c70e5/tree_sitter_solidity-1.2.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-29 09:49:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JoranHonig",
"github_project": "tree-sitter-solidity",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-sitter-solidity"
}