python-solidity-parser icon indicating copy to clipboard operation
python-solidity-parser copied to clipboard

Various fixes/missing fields

Open florian1345 opened this issue 2 years ago • 2 comments

Just an informal collection of problems I encountered and fixed locally. Sorry for not presenting it in a more organized way. Feel free to modify/integrate it however you like.

  • Added name field to TypeDefinition nodes
  • Added isVirtual and isOverride fields to ModifierDefinition nodes
  • Added support for parsing for FunctionCallOptions (of the form fn{key=value}(args))
  • Added support for parsing IndexRangeAccesses (of the form array[from:to])
  • Added proper nodes for the ReturnStatement, BreakStatement, and ContinueStatement (which were previously rendered as the return expression or just ';' for expression-less statements)
  • Fixed parser discarding all variable declarations in a variable declaration list if one is None
  • Fixed parser failing if an assembly member's identifier is a list (not quite sure where that was a problem TBH)
  • Fixed parser failing an assembly assignment to a member

I added some more fixes with commit eb548d1 on 2022-05-12:

  • Added isDeclaredImmutable to variable declaration, similar to isDeclaredConst
  • Rendered omitted loop expressions in for loops as None instead of an ExpressionStatement with None as its expression
  • Added storageLocation field to variable declarations inside a variable declaration list

florian1345 avatar Apr 12 '22 21:04 florian1345

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 12 '22 21:04 CLAassistant

Would that be okay to review and merge this PR @tintinweb ?

nodablock avatar Dec 28 '22 09:12 nodablock