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

fix(grainfmt): Format rational numbers with parens when needed for precedence #1385

Merged
merged 5 commits into from
Aug 4, 2022

Conversation

marcusroberts
Copy link
Member

@marcusroberts marcusroberts commented Jul 30, 2022

Fixes #1374

When formatting rational numbers, add a parens when the number is on the rhs to ensure correct precedence

The numbers test suite is formatted and passed, but please check for style

@marcusroberts marcusroberts marked this pull request as draft July 30, 2022 11:20
@marcusroberts marcusroberts marked this pull request as ready for review July 30, 2022 18:03
@marcusroberts marcusroberts changed the title fix(grainfmt): Format rational numbers with parens when taking part in an infix divide fix(grainfmt): Format rational numbers with parens when needed for precedence Jul 30, 2022
@ospencer ospencer force-pushed the marcus/fix_rational_number_format branch 4 times, most recently from b6477e7 to bdda868 Compare July 31, 2022 16:08
@ospencer ospencer force-pushed the marcus/fix_rational_number_format branch from bdda868 to 44c10df Compare July 31, 2022 16:16
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@phated phated merged commit 931bb42 into main Aug 4, 2022
@phated phated deleted the marcus/fix_rational_number_format branch August 4, 2022 18:47
@github-actions github-actions bot mentioned this pull request Aug 4, 2022
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.

Grainfmt: Formatting causes math operations to change
3 participants