prettier-plugin-solidity icon indicating copy to clipboard operation
prettier-plugin-solidity copied to clipboard

Missing node types

Open Janther opened this issue 5 years ago • 2 comments

Given the last few issues I started reviewing what we were missing from the list of node types of the parser.

According to solidity parsers node list we are still missing these nodes:

  • [ ] AssemblyFunctionReturns
  • [ ] AssemblyItem
  • [ ] AssemblyLiteral
  • [ ] AssemblyStackAssignment
  • [ ] Break
  • [ ] Continue
  • [ ] IdentifierList
  • [ ] PragmaName
  • [ ] PragmaValue
  • [ ] StateMutability
  • [ ] StorageLocation
  • [ ] SubAssembly

In the same review I discovered that the list doesn't include these nodes that we do have:

  • [ ] CatchClause
  • [ ] IndexRangeAccess
  • [ ] NewExpression
  • [ ] TryStatement

@fvictorio could you do a cleanup of that list and let us know which node we do need to implement?

Janther avatar May 14 '20 01:05 Janther

I'm running into the following error:

Error: Unknown type: "Continue"

due to having continue in an assembly block. Is this getting addressed at some point?

marcusnewton avatar Jul 07 '22 04:07 marcusnewton

@marcusnewton thanks, I opened https://github.com/prettier-solidity/prettier-plugin-solidity/issues/699 to track that issue.

fvictorio avatar Jul 11 '22 09:07 fvictorio

@Janther I believe we support all nodes now (or we will, after merging #750). I'd say we close this one, and then open new issues if we missed some node.

fvictorio avatar Oct 25 '22 10:10 fvictorio

Ok @fvictorio I did a review of this and we are still missing AssemblyFunctionReturns and SubAssembly.

I'll do a quick check and see what specifically these nodes are and implement them in our printers. If they are unused, you could just clean up these 2 in the parser.

Update: I did not find an example of these 2 nodes in the parser's tests so maybe they existed at some moment and later removed?

Janther avatar Nov 14 '22 00:11 Janther

Thank you @Janther, I checked and the SubAssembly node is not used at all. The AssemblyFunctionReturns is used in the ANTLR grammar, but abstracted by the parser, so that node doesn't make sense in ast-types.ts either and I removed it.

fvictorio avatar Nov 19 '22 11:11 fvictorio