-
Notifications
You must be signed in to change notification settings - Fork 45
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
Handle commas in assembly assignment #60
Comments
Would this issue be a good candidate for a new code contributor? |
I'm not sure how hard it is, but feel free to give it a try and let me know if you need help! The grammar seems to already support this kind of assignment (although it's not included in the test file), so my guess is that the problem is in the ASTBuilder. The relevant section in that module is this one. That also looks correct, so I'm not sure why it's not working tbh. |
Oh, I see the problem now. It seems that multiple assignments are only supported when you use parentheses. Maybe this is how solidity used to work but it changed at some point? So, the things to do are:
Updating the grammar without causing breaking changes is always tricky. My guess is that just changing this:
to this:
might work. |
Thanks for the feedback! I think that would fix the issue, but it would be a bit too permissive. I found in SolidityParser.g4 that multi-assignments require a function call:
Because of that I don't think the current implementation is correct. I mean can This is a more generic question, maybe a bit out of scope of this issue: is there any plan to swap the dependency from |
This parser is very permissive and processes a lot of invalid (that is: non-compilable) solidity code. The main reason is that it has to work with all versions of solidity, and the easiest way to do that is to accept a lot of things that are not semantically valid.
I don't think so, for the same reason: the parser in |
This is valid code but it generates a parsing error in the
let i, j
line:The text was updated successfully, but these errors were encountered: