Skip to content

contractshark/tree-sitter-solidity

 
 

Repository files navigation

🌴 tree-sitter-solidity

Node.js CI npm version

💡 this grammar is still in development, the structure of the generated AST is not stable

This repository contains a grammar for 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:

-> 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!

About

Solidity grammar for tree sitter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 97.4%
  • JavaScript 1.5%
  • Solidity 0.7%
  • Scheme 0.2%
  • Rust 0.2%
  • C++ 0.0%