mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ca3afea1d7
SourceUnit = Error $ Block = '{' Error '}' ContractDefinition = '{' Error '}' Statement = Error ';' Co-Authored-By: chriseth <chris@ethereum.org>
24 lines
847 B
Solidity
24 lines
847 B
Solidity
// Example which where scanning hits EOS, so we reset.
|
|
// Here we recover in the contractDefinition.
|
|
// There should be an an AST created this contract (with errors).
|
|
contract Error2 {
|
|
mapping (address => uint balances) // missing ;
|
|
}
|
|
|
|
// There is no error in this contract
|
|
contract SendCoin {
|
|
function sendCoin(address receiver, uint amount) public returns(bool sufficient) {
|
|
if (balances[msg.sender] < amount) return false;
|
|
balances[msg.sender] -= amount;
|
|
balances[receiver] += amount;
|
|
emit Transfer(msg.sender, receiver, amount);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// ----
|
|
// ParserError: (212-220): Expected ')' but got identifier
|
|
// ParserError: (220-221): Expected ';' but got ')'
|
|
// ParserError: (220-221): Function, variable, struct or modifier declaration expected.
|
|
// Warning: (235-236): Recovered in ContractDefinition at '}'.
|