summary refs log tree commit diff stats
path: root/compiler/layouter.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/layouter.nim')
-rw-r--r--compiler/layouter.nim11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim
index 409b656c9..62844db4b 100644
--- a/compiler/layouter.nim
+++ b/compiler/layouter.nim
@@ -74,9 +74,10 @@ template wr(x) =
 template goodCol(col): bool = col in 40..MaxLineLen
 
 const
-  splitters = {tkComma, tkSemicolon, tkParLe, tkParDotLe,
-               tkBracketLe, tkBracketLeColon, tkCurlyDotLe,
-               tkCurlyLe}
+  openPars = {tkParLe, tkParDotLe,
+              tkBracketLe, tkBracketLeColon, tkCurlyDotLe,
+              tkCurlyLe}
+  splitters = openPars + {tkComma, tkSemicolon}
   oprSet = {tkOpr, tkDiv, tkMod, tkShl, tkShr, tkIn, tkNotin, tkIs,
             tkIsnot, tkNot, tkOf, tkAs, tkDotDot, tkAnd, tkOr, tkXor}
 
@@ -169,7 +170,9 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
   of tokKeywordLow..tokKeywordHigh:
     if endsInAlpha(em):
       wr(" ")
-    elif not em.inquote and not endsInWhite(em) and tok.tokType in oprSet:
+    elif not em.inquote and not endsInWhite(em) and
+        em.lastTok notin openPars:
+      #and tok.tokType in oprSet
       wr(" ")
 
     if not em.inquote: