Skip to content

Commit

Permalink
Capture trivia of int64 number. Fixes #1120 (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Sep 10, 2020
1 parent af13688 commit 5632847
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Fantomas.Tests/SynConstTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,9 @@ let f (a: int) =
| 0x55 -> Some()
| _ -> None
"""

[<Test>]
let ``preserve underscore in int64, 1120`` () =
formatSourceString false "let x = 60_000L" config
|> should equal "let x = 60_000L
"
1 change: 1 addition & 0 deletions src/Fantomas/TokenParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ let private numberTrivia =
"UINT32"
"INT32"
"UINT64"
"INT64"
"IEEE32"
"DECIMAL"
"IEEE64"
Expand Down

0 comments on commit 5632847

Please sign in to comment.