prettier-plugin-solidity
prettier-plugin-solidity copied to clipboard
Missing node types
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?
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 thanks, I opened https://github.com/prettier-solidity/prettier-plugin-solidity/issues/699 to track that issue.
@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.
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?
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.