Solidity parser in Go, designed to transform Solidity code into a structured format for enhanced analysis, particularly beneficial for developers using Go to analyze Solidity smart contracts.
Parsing a function without arguments, for example increment() returns (uint256), we are not getting the correct arguments in the resulting function declaration node.
Expected:Parameters: nil and ReturnParameters: uint256Actual:Paramters: uint256 and ReturnParameters: uint256
Problem
Parsing a function without arguments, for example
increment() returns (uint256)
, we are not getting the correct arguments in the resulting function declaration node.Expected:
Parameters: nil
andReturnParameters: uint256
Actual:Paramters: uint256
andReturnParameters: uint256
The source of this bug is likely the lines below, where we are getting the params fron
AllParameterList
instead ofGetArguments
. https://github.com/unpackdev/solgo/blob/aa00b43da981742fa9670f0323b838e1bf77e6ef/ast/function.go#L430 https://github.com/unpackdev/solgo/blob/aa00b43da981742fa9670f0323b838e1bf77e6ef/ast/function.go#L534Suggestion
We can change it from
to