Skip to content

Commit

Permalink
nimpretty: fixes #9673 [backport]
Browse files Browse the repository at this point in the history
(cherry picked from commit 5326471)
  • Loading branch information
Araq authored and narimiran committed Nov 24, 2018
1 parent 172e95b commit fa3017f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/layouter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
wr(TokTypeToStr[tok.tokType])
if not em.inquote: wr(" ")
of tkOpr, tkDotDot:
if tok.strongSpaceA == 0 and tok.strongSpaceB == 0:
if (tok.strongSpaceA == 0 and tok.strongSpaceB == 0) or em.inquote:
# bug #9504: remember to not spacify a keyword:
lastTokWasTerse = true
# if not surrounded by whitespace, don't produce any whitespace either:
Expand Down
3 changes: 3 additions & 0 deletions nimpretty/tests/exhaustive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,6 @@ proc fun3() =
##[
foobar
]##

# bug #9673
discard `* `(1, 2)
3 changes: 3 additions & 0 deletions nimpretty/tests/expected/exhaustive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,6 @@ proc fun3() =
##[
foobar
]##

# bug #9673
discard `*`(1, 2)

0 comments on commit fa3017f

Please sign in to comment.