Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uppretty-printer loses parens in "if (1 == fail) { }" #929
Comments
This comment has been minimized.
This comment has been minimized.
|
Yes, I agree with your solution. print_maybe_parens_discrim should be looking at the rightmost expression. |
brson
added a commit
that referenced
this issue
Feb 6, 2012
ghost
assigned
catamorphism
Mar 15, 2012
This comment has been minimized.
This comment has been minimized.
|
Reproduced as of 7/26/2012. |
This comment has been minimized.
This comment has been minimized.
|
Fixed now that we have paren nodes. |
catamorphism
closed this
Nov 16, 2012
jruderman
unassigned
catamorphism
Jun 16, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jruderman commentedSep 16, 2011
and
lose their parens, becoming something that fails to parse:
This could be solved by parenthesizing the whole discriminant, parenthesizing just the "fail", or getting rid of the syntactic ambiguity. I see a way to do the first option, by making pprust::print_maybe_parens_discrim recurse right. I could write that patch, along with tests, if you think it's the right thing to do.