diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-11-11 10:07:19 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-11-11 10:39:20 +0100 |
commit | 532647171e013ed9f8847a4f97ebca0fc6dfc57f (patch) | |
tree | 3122196e644221476b66125f212d3ab05976adf5 | |
parent | c0b5479e6b9cdd1b37f6d493298bf7a76968e1e1 (diff) | |
download | Nim-532647171e013ed9f8847a4f97ebca0fc6dfc57f.tar.gz |
nimpretty: fixes #9673 [backport]
-rw-r--r-- | compiler/layouter.nim | 2 | ||||
-rw-r--r-- | nimpretty/tests/exhaustive.nim | 3 | ||||
-rw-r--r-- | nimpretty/tests/expected/exhaustive.nim | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim index f96f88da1..ad4eb7488 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -245,7 +245,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 9202de703..9a0f9a49b 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 6d000d524..8ea7ca4dd 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) |