Closed aoli-al closed 5 years ago
Yes, it could be simplified, but the official AST output from solc
uses the same node type for all of them AFAIK and I could not find a strong enough case for doing things differently.
If you have a specific use case in mind that could benefit from this change I would be open to considering it.
I see. It is reasonable to have the same output as solc
parser.
Thanks!
However, the current AST format is very different from solc
's though?
It is, and that is a little bit problematic. I would like to bring it closer over time.
Can
VariableDeclaration
be simplified? Currently,VariableDeclaration
contains many redundant information.For example,
isStateVar
,visibility
, andisDeclaredConst
are only used when the variable is a state variable. Can we move the information toStateVariableDeclaration
? Besides,StateVariableDeclaration
will always have oneVariableDeclaration
object.I guess we can refactor
VariableDeclaration
to:typeName
,name
, andstorageLocation
.Another question is why eventParameter, functionParameter, and variableDeclaration share the same variableDeclaration object? Can we separate them?