-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Seemingly) irrelevant data being created #56
Comments
@duaraghav8 What did you change in solidity-parser to get the solparse output? |
OK, the problem is caused by this rule:
Those first two rules do not parse to AssignmentExpression or DeclarativeExpression nodes but to arrays with the whitespace and EOS result as items too. I propose to define StateVariableDeclaration as this:
And replace it in the The problem is that the layout for the AssignmentExpression and DeclarativeExpression are very different. AssignmentExpression has left, right and operator keys, where left is a DeclarativeExpression. StateVariableDeclaration should return a node with a consistent layout. What do you think? |
Code:
sp.parse (code).body [0]
yields:Observer the
body
of the ContractStatement (first object isDeclarativeExpression
, which is fine. But what's happening after this?). Its taking semicolon as a separate entity, whereas the semicolon, together with an expression before that, makeExpressionStatement
.My fix in solparse creates the following structure:
@cgewecke is working on moving all fixes in solparse to solidity-parser. Please comment on the structure elicited by solparse above, so we can finalize.
The text was updated successfully, but these errors were encountered: