python-solidity-parser
python-solidity-parser copied to clipboard
Fix missing ident with omitted fields in tuple assignment
The parser will fail if we omit fields in tuple assignment, for example with the following contract Simple.sol
,
pragma solidity ^0.8.0;
contract Simple {
function withdraw(uint _amount) public {
if (_amount > 1000){
(bool result,) = msg.sender.call{value:_amount}("");
require(result);
}
}
}
python -m solidity_parser outline Simple.sol
fails with Exception: unrecognized expression
This PR fixes the error by checking the existance of identifier
before getting the text name from it.