Skip to content

Commit

Permalink
Add ticks to mod identifier. Fixes #1960. (#1963)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 9, 2021
1 parent 758347b commit a40a7e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Fantomas.Tests/SignatureTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,25 @@ type Foo =
static member Baz: int
"""

[<Test>]
let ``mod name in val, 1960`` () =
formatSourceString
true
"""
module X
val ``mod``: t -> t -> t
"""
config
|> prepend newline
|> should
equal
"""
module X
val ``mod``: t -> t -> t
"""

[<Test>]
let ``literals in signatures, 1953`` () =
formatSourceString
Expand Down
1 change: 1 addition & 0 deletions src/Fantomas/SourceParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ let (|Ident|) (s: Ident) =
| "not" -> "not"
| "params" -> "``params``"
| "parallel" -> "``parallel``"
| "mod" -> "``mod``"
| _ ->
if IsActivePatternName ident then
sprintf "(%s)" (DecompileOpName ident)
Expand Down

0 comments on commit a40a7e9

Please sign in to comment.