diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/layouter.nim | 4 | ||||
-rw-r--r-- | compiler/parser.nim | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim index cc6ec48b7..d03105eb2 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -31,7 +31,7 @@ type inquote: bool semicolons: SemicolonKind col, lastLineNumber, lineSpan, indentLevel, indWidth: int - nested: int + inParamList*: int doIndentMore*: int content: string indentStack: seq[int] @@ -142,7 +142,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) = em.fixedUntil = em.content.high elif tok.indent >= 0: - if em.lastTok in (splitters + oprSet): + if em.lastTok in (splitters + oprSet) or em.inParamList > 0: em.indentLevel = tok.indent else: if tok.indent > em.indentStack[^1]: diff --git a/compiler/parser.nim b/compiler/parser.nim index 54aaf8194..cf64ad555 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -1037,6 +1037,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode = addSon(result, p.emptyNode) # return type when defined(nimpretty2): inc p.em.doIndentMore + inc p.em.inParamList let hasParLe = p.tok.tokType == tkParLe and p.tok.indent < 0 if hasParLe: getTok(p) @@ -1073,6 +1074,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode = result = p.emptyNode when defined(nimpretty2): dec p.em.doIndentMore + dec p.em.inParamList proc optPragmas(p: var TParser): PNode = if p.tok.tokType == tkCurlyDotLe and (p.tok.indent < 0 or realInd(p)): |