-
Notifications
You must be signed in to change notification settings - Fork 73
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
issue w/ for statement #64
Comments
Just repeating what we've already said elsewhere. The problem seems to be here: prettier-plugin-solidity/src/printer.js Lines 164 to 170 in 6428414
where we add a semicolon only if the parent node is not a for statement. But if we don't do this, then an extra semicolon is added to the loop condition, because that is an An extremely ugly fix would be to mutate the node so that the print function knows if it should add the semicolon. I don't like this, but it could work. Another idea is to never add a semicolon in the |
I like the second option much more but if we can have something that still fixes the problem I really don't mind if it's really terrible tbh; happy if you want to create a PR that fixes this issue btw |
The more I think about this, the more convinced I am that this is a problem upstream, so I opened federicobond/solidity-parser-antlr#39 to see if it can be changed. But this may be a breaking change, so I don't know if it will be modified/fixed. I say we do this: if the parser is modified and that allows us to do a proper fix, we do that. If not, let's do the easy/mutating approach, and revisit it later if needed. |
shall we decorate our parser so that it returns the structure we think it's more beneficial for us? that be also another option what do you think? |
That's a great idea. Let's do that for now. |
Description
missing a semicolon if for statement body is not included in braces.
Source
Prettified
The text was updated successfully, but these errors were encountered: