Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joranhonig/tree-sitter-solidity
Solidity grammar for tree sitter
https://github.com/joranhonig/tree-sitter-solidity
grammar hacktoberfest parser smart-contracts solidity tree-sitter
Last synced: 6 days ago
JSON representation
Solidity grammar for tree sitter
- Host: GitHub
- URL: https://github.com/joranhonig/tree-sitter-solidity
- Owner: JoranHonig
- License: mit
- Created: 2020-08-29T15:01:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-13T11:20:45.000Z (14 days ago)
- Last Synced: 2024-12-14T19:03:31.893Z (13 days ago)
- Topics: grammar, hacktoberfest, parser, smart-contracts, solidity, tree-sitter
- Language: Python
- Homepage:
- Size: 2.69 MB
- Stars: 144
- Watchers: 7
- Forks: 42
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 🌴 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!