solidity/test/libsolidity/errorRecoveryTests/constructor_recovers.sol
rocky ca3afea1d7 Add Steve Johnson-style parser recovery rules:
SourceUnit = Error $
    Block = '{' Error '}'
    ContractDefinition = '{' Error '}'
    Statement = Error ';'

Co-Authored-By: chriseth <chris@ethereum.org>
2019-06-17 14:47:07 +02:00

21 lines
547 B
Solidity

pragma solidity >=0.0.0;
contract Error1 {
constructor() public {
balances[tx.origin] = ; // missing RHS.
}
// Without error recovery we stop due to the above error.
// Error recovery however recovers at the above ';'
// There should be an AST for the above, albeit with error
// nodes.
// This function parses properly and should give AST info.
function five() public view returns(uint) {
return 5;
}
}
// ----
// ParserError: (95-96): Expected primary expression.
// Warning: (95-96): Recovered in Statement at ';'.