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 of ast tree does not handle the case where the statementContext.Block() != nil and statementContext.Empty() == false. This happens when we have a single statement if statement such as if (block.timestamp <= time) revert TooLate(time);.
Problem
Parsing of
ast
tree does not handle the case where thestatementContext.Block() != nil
andstatementContext.Empty() == false
. This happens when we have a single statement if statement such asif (block.timestamp <= time) revert TooLate(time);
.Suggestion
Add a line to handle that case in
ast/if.go
: https://github.com/unpackdev/solgo/blob/87b65765ed0f5a26b0b1904c65a1bc2c9b69cd67/ast/if.go#L191