ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Parse "returns" in FunctionDeclaration #85

Closed duaraghav8 closed 7 years ago

duaraghav8 commented 7 years ago

Fixes #80

NOTE: returns cannot be without at least a single parameter. returns & returns () throw errors (same behaviour as solc). returns (uint), etc get parsed fine.

federicobond commented 7 years ago

Thank you Raghav! 🙌

duaraghav8 commented 7 years ago

@federicobond You only changed it for 1 declaration. There are actually 2 FunctionDeclaration definitions (joined by OR) - 1 for Function with body and another for abstract func.

See here: https://github.com/ConsenSys/solidity-parser/blob/master/solidity.pegjs#L1389

Please change the second one to returnParams too.

federicobond commented 7 years ago

Fixed. Thanks!