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 authored Nov 8, 2021
1 parent b8509dd commit 930ba93
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 @@ -1601,3 +1601,22 @@ type Foo =
Qux: string }
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
"""
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 930ba93

Please sign in to comment.