Conversation
| } | ||
|
|
||
| return ast_pb.StorageLocation_MEMORY | ||
| return ast_pb.StorageLocation_DEFAULT |
There was a problem hiding this comment.
I changed this from Memory to Default because we needed a way to print the storage location "memory" only when it is specified in the original antlr ast.
| Visibility ast_pb.Visibility `json:"visibility"` // Visibility of the state variable declaration | ||
| StorageLocation ast_pb.StorageLocation `json:"storage_location"` // Storage location of the state variable declaration | ||
| StateMutability ast_pb.Mutability `json:"mutability"` // State mutability of the state variable declaration | ||
| Override bool `json:"is_override"` // Indicates if the state variable is an override |
There was a problem hiding this comment.
Introduced an Override for StateVariableDeclaration, eg address public override owner;
There was a problem hiding this comment.
Nice one, I missed that one 🎃
0x19
left a comment
There was a problem hiding this comment.
It's all going nice way! Thank you a lot man!
Some of the things that I believe needs to be a part of this PR:
- Documentation in general, it's lacking.
- There are no unit tests, please at least add few of them. Does not have to be 100% code coverage even tho 80+ is preferred. We at least need to have for example 1-2 contracts, a table driven test that produces expected results back.
| } | ||
| // Edge case for single statement if | ||
| // Eg: if (a) b; | ||
| body.parseStatements(unit, contractNode, fnNode, statementCtx.GetChild(0)) |
There was a problem hiding this comment.
This too me sounds like that it could have potential side-effects. It should probably be checked if block itself is not nil? Going to test it as well and should for sure, as we started be part of the different PR, not this one.
| } | ||
|
|
||
| return ast_pb.StorageLocation_MEMORY | ||
| return ast_pb.StorageLocation_DEFAULT |
| Visibility ast_pb.Visibility `json:"visibility"` // Visibility of the state variable declaration | ||
| StorageLocation ast_pb.StorageLocation `json:"storage_location"` // Storage location of the state variable declaration | ||
| StateMutability ast_pb.Mutability `json:"mutability"` // State mutability of the state variable declaration | ||
| Override bool `json:"is_override"` // Indicates if the state variable is an override |
There was a problem hiding this comment.
Nice one, I missed that one 🎃
| v.Constant = constantCtx != nil | ||
| } | ||
|
|
||
| v.Override = ctx.GetOverrideSpecifierSet() |
There was a problem hiding this comment.
Could this panic in case that there's no specifier set? basically if not nil to set it?
| v.Constant = constantCtx != nil | ||
| } | ||
|
|
||
| v.Override = ctx.GetOverrideSpecifierSet() |
Introduced a new package called
ast_printerto printast.Node[ast.NodeType]to solidity source code.Right now, we do not support the printing of all the nodes, and we haven't tested it rigorously yet, but would love to get some feedback on what changes need to be made to integrate this into the codebase 🤩
Heres an example of how you would use this: