Open monperrus opened 2 years ago
Nice idea!
Apparently there is also a tree sitter grammar : https://github.com/JoranHonig/tree-sitter-solidity
I looked a little bit into the output of solc
and it wouldn't be straightforward, the AST is quite far from the CST and lacking a lot of textual position information 😢
I'll try to see if I get more luck with the tree-sitter one ^^
cool, thanks for the update
ok the tree-sitter version seems a little unstable I got a ValueError: Incompatible Language version 12. Must be between 13 and 13
, so I'll have to retry that at some point in the future when it's more stable
Hello there. I found a parser: https://github.com/solidity-parser/parser I wonder if it could be used in this case.
Hi, apparently there is a ANTLR grammar related to the code you point out here : https://github.com/solidityj/solidity-antlr4
And we have support for antlr grammars, so that might worth a try.
For the record, we have a first prototype at https://github.com/mojtaba-eshghie/solidity-code-diff
it would be great to add support for diffing Solidity.
For this we can use the existing support from solidity compiler solc
Flag
--ast-compact-json
gives the "AST of all source files in a compact JSON format."