From fa3017f6bbc2269759ac354cd306a154df7ba780 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 11 Nov 2018 10:07:19 +0100 Subject: [PATCH] nimpretty: fixes #9673 [backport] (cherry picked from commit 532647171e013ed9f8847a4f97ebca0fc6dfc57f) --- compiler/layouter.nim | 2 +- nimpretty/tests/exhaustive.nim | 3 +++ nimpretty/tests/expected/exhaustive.nim | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/layouter.nim b/compiler/layouter.nim index b801a0273b..8605ade456 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -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: diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim index 9202de703d..9a0f9a49bb 100644 --- a/nimpretty/tests/exhaustive.nim +++ b/nimpretty/tests/exhaustive.nim @@ -357,3 +357,6 @@ proc fun3() = ##[ foobar ]## + +# bug #9673 +discard `* `(1, 2) diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index 6d000d524e..8ea7ca4dd6 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -366,3 +366,6 @@ proc fun3() = ##[ foobar ]## + +# bug #9673 +discard `*`(1, 2)