diff options
author | Araq <rumpf_a@web.de> | 2013-12-13 01:21:23 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-13 01:21:23 +0100 |
commit | 328f1932925889d5bb7f91c68fb1504b9b26ba8c (patch) | |
tree | f26fa7993b085104fef4d54701d27eae5f40cc18 /compiler/renderer.nim | |
parent | 6db20a4be8556621b3a33f87854b4b857c4dcf9e (diff) | |
download | Nim-328f1932925889d5bb7f91c68fb1504b9b26ba8c.tar.gz |
new VM: globals kinda work
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r-- | compiler/renderer.nim | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index f6fb0f8c0..c8fe70e02 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -557,7 +557,7 @@ proc longMode(n: PNode, start: int = 0, theEnd: int = - 1): bool = proc gstmts(g: var TSrcGen, n: PNode, c: TContext) = if n.kind == nkEmpty: return - if (n.kind == nkStmtList) or (n.kind == nkStmtListExpr): + if n.kind in {nkStmtList, nkStmtListExpr, nkStmtListType}: indentNL(g) for i in countup(0, sonsLen(n) - 1): optNL(g) @@ -1069,7 +1069,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkSpaces, Space) putWithSpace(g, tkEquals, "=") gsub(g, n.sons[1]) - of nkStmtList, nkStmtListExpr: gstmts(g, n, emptyContext) + of nkStmtList, nkStmtListExpr, nkStmtListType: gstmts(g, n, emptyContext) of nkIfStmt: putWithSpace(g, tkIf, "if") gif(g, n) @@ -1246,8 +1246,12 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkBracketLe, "[") gcomma(g, n) put(g, tkBracketRi, "]") + of nkMetaNode: + put(g, tkParLe, "(META|") + gsub(g, n.sons[0]) + put(g, tkParRi, ")") else: - #nkNone, nkMetaNode, nkExplicitTypeListCall: + #nkNone, nkExplicitTypeListCall: InternalError(n.info, "rnimsyn.gsub(" & $n.kind & ')') proc renderTree(n: PNode, renderFlags: TRenderFlags = {}): string = |