Skip to content
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

PrettyPrinter\\Standard: fixes nested ternaries output; #719

Closed
wants to merge 1 commit into from

Conversation

rentalhost
Copy link

Fixes #718

That fixes it, but I don't know if it's the best way.

I also had to modify one of the tests, because it is "positively affected" by this commit. The previous expected output would generate the error mentioned in #718.

@nikic
Copy link
Owner

nikic commented Sep 30, 2020

Thanks for the PR! I've applied a simpler fix in eff72ee. This is just a matter of marking the operator as non-associative.

@nikic nikic closed this Sep 30, 2020
@rentalhost
Copy link
Author

Oh! I almost got it right on my first attempts! I have tried 1 but it brokes other tests. I didn't notice that 0 could be tested as well. Haha!

Thanks a lot for this quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PrettyPrinter brokes nested ternaries
2 participants