2019-05-27 14:13:27 +00:00
|
|
|
// An example with multiple errors.
|
|
|
|
// Most are caught by inserting an expected token.
|
|
|
|
// However some us S C Johnson recovery to
|
|
|
|
// skip over tokens.
|
|
|
|
|
|
|
|
pragma solidity >=0.0.0;
|
|
|
|
|
|
|
|
contract Error4 {
|
|
|
|
constructor() public {
|
|
|
|
balances[tx.origin] = 1 2; // missing operator
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendCoin(address receiver, uint amount) public returns(bool sufficient) {
|
|
|
|
if (balances[msg.sender] < amount) return false;
|
|
|
|
balances[msg.sender] -= amount // Missing ";"
|
|
|
|
balances[receiver] += amount // Another missing ";"
|
|
|
|
emit Transfer(msg.sender // truncated line
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
// ----
|
2020-06-19 00:26:46 +00:00
|
|
|
// ParserError 6635: (249-250): Expected ';' but got 'Number'
|
|
|
|
// ParserError 6635: (471-479): Expected ';' but got identifier
|
|
|
|
// ParserError 6635: (529-533): Expected ';' but got 'emit'
|
|
|
|
// ParserError 6635: (577-583): Expected ',' but got 'return'
|
|
|
|
// ParserError 6933: (577-583): Expected primary expression.
|
|
|
|
// Warning 3796: (588-589): Recovered in Statement at ';'.
|