2 个版本
0.0.2 | 2023 年 4 月 14 日 |
---|---|
0.0.1 | 2023 年 4 月 13 日 |
#316 in 文本编辑器
22 每月下载量
2MB
62K SLoC
🌴 tree-sitter-solidity
💡 此语法仍在开发中,生成的 AST 结构尚不稳定
此仓库包含一个针对 tree-sitter 的语法。
此项目的目标是提供一个高效且依赖性低的解析器,用于解析 Solidity,旨在支持大多数使用的 Solidity 版本,并设计用于启用元编程。
浏览此仓库
此仓库的主要文件是 grammar.js
,它描述了 tree-sitter 语法。
# Primary file:
grammar.js
# Tests:
/test/**/*
# Auto generated:
/src/**/*
index.js
binding.gyp
参考
-> 以太坊 Solidity 语法
- 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.cn/en/latest/grammar.html?#
-> Tree-sitter JavaScript 语法: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/grammar.js
-> Solidity ANTLR 语法: https://github.com/ConsenSys/solidity-parser-antlr
此项目的灵感主要来自 tree-sitter-javascript,并采用了其中的一些结构,在此特别感谢此仓库的贡献者!
依赖项
~2.6–4MB
~68K SLoC