-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(grainfmt): Format rational numbers with parens when needed for pr…
…ecedence (#1385) Co-authored-by: Oscar Spencer <[email protected]>
- Loading branch information
1 parent
4363ad1
commit 931bb42
Showing
4 changed files
with
49 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Int32 from "int32" | ||
|
||
let a = Int32.toNumber(3l) * (2/3) | ||
|
||
let b = 2/3 + Int32.toNumber(4l) | ||
|
||
let c = Int32.toNumber(3l) + (2/3) | ||
|
||
let x = 3 * (2/3) | ||
|
||
let y = 2/3 + 4 | ||
|
||
let z = 3 + (2/3) | ||
|
||
assert 4 * (2/3) == 8/3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Int32 from "int32" | ||
|
||
let a = Int32.toNumber(3l) * (2/3) | ||
|
||
let b = 2/3 + Int32.toNumber(4l) | ||
|
||
let c = Int32.toNumber(3l) + 2/3 | ||
|
||
let x = 3 * (2/3) | ||
|
||
let y = 2/3 + 4 | ||
|
||
let z = 3 + 2/3 | ||
|
||
assert 4 * (2/3) == 8/3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters