diff options
author | EXetoC <exetoc@gmail.com> | 2014-03-06 02:46:31 +0100 |
---|---|---|
committer | EXetoC <exetoc@gmail.com> | 2014-03-06 02:46:31 +0100 |
commit | d1bc6cf0981eddf283515c2d77bccca76abff99f (patch) | |
tree | ac28e32bd6143c7a06c44dbea632f28f65ea3d20 /compiler/renderer.nim | |
parent | 853bdbf4948db7774bc3caf74f67ba1228f65016 (diff) | |
parent | 7904446c47f952a026d408f04431dbaf6d887b37 (diff) | |
download | Nim-d1bc6cf0981eddf283515c2d77bccca76abff99f.tar.gz |
Merge branch 'devel' into alloc-overloads
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r-- | compiler/renderer.nim | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 1afb5961e..d68cb91c0 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -558,16 +558,19 @@ proc longMode(n: PNode, start: int = 0, theEnd: int = - 1): bool = result = true break -proc gstmts(g: var TSrcGen, n: PNode, c: TContext) = - if n.kind == nkEmpty: return +proc gstmts(g: var TSrcGen, n: PNode, c: TContext, doIndent=true) = + if n.kind == nkEmpty: return if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: - indentNL(g) - for i in countup(0, sonsLen(n) - 1): + if doIndent: indentNL(g) + for i in countup(0, sonsLen(n) - 1): optNL(g) - gsub(g, n.sons[i]) + if n.sons[i].kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: + gstmts(g, n.sons[i], c, doIndent=false) + else: + gsub(g, n.sons[i]) gcoms(g) - dedent(g) - else: + if doIndent: dedent(g) + else: if rfLongMode in c.flags: indentNL(g) gsub(g, n) gcoms(g) @@ -1268,7 +1271,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkBracketLe, "[") gcomma(g, n) put(g, tkBracketRi, "]") - of nkMetaNode: + of nkMetaNode_Obsolete: put(g, tkParLe, "(META|") gsub(g, n.sons[0]) put(g, tkParRi, ")") |