federicobond / solidity-parser-antlr

A Solidity parser for JS built on top of a robust ANTLR4 grammar
MIT License
155 stars 55 forks source link

incorrectly parses abstract func whose name is at the end #16

Closed duaraghav8 closed 6 years ago

duaraghav8 commented 6 years ago
contract Foo {
    function(address) external returns (address) myFunc;
}

This code compiles (notice that the function's name is right before semicolon).

Unfortunately I haven't been able to find any literature on the exact rules the compiler follows in this situation. Couldn't find anything helpful in the solidity grammar either.

(This pattern is not used very often, so not a big problem IMO)

federicobond commented 6 years ago

Hey! Sorry for the delay. The code you posted is a state variable of function type. This should no longer be an issue with the latest published version, please reopen if that's not the case.

duaraghav8 commented 6 years ago

ah yes, I only very recently realised this myself, thanks!