diff options
author | Araq <rumpf_a@web.de> | 2013-12-27 16:35:21 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-27 16:35:21 +0100 |
commit | a427648c48d99be292cb37b6c53bd1205414ad59 (patch) | |
tree | 499b22b27dc05334595db9114556a7db5ab8c1d6 /compiler/pretty.nim | |
parent | 2df9b442c646e06cc577a723dc2592275bf9b6f5 (diff) | |
download | Nim-a427648c48d99be292cb37b6c53bd1205414ad59.tar.gz |
case consistency part 2
Diffstat (limited to 'compiler/pretty.nim')
-rw-r--r-- | compiler/pretty.nim | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 2955193d0..095a132b3 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -273,17 +273,13 @@ proc check(c: PGen, n: PNode) = nkMacroDef, nkConverterDef: checkDef(c, n[namePos]) for i in namePos+1 .. <n.len: check(c, n.sons[i]) - of nkVarSection, nkLetSection: - for i in countup(0, sonsLen(n) - 1): - let a = n.sons[i] - if a.kind == nkCommentStmt: continue - if a.kind != nkIdentDefs and a.kind != nkVarTuple: - globalError(a.info, errGenerated, "invalid ast") - checkMinSonsLen(a, 3) - let L = len(a) - for j in countup(0, L-3): checkDef(c, a.sons[j]) - check(c, a.sons[L-2]) - check(c, a.sons[L-1]) + of nkIdentDefs, nkVarTuple: + let a = n + checkMinSonsLen(a, 3) + let L = len(a) + for j in countup(0, L-3): checkDef(c, a.sons[j]) + check(c, a.sons[L-2]) + check(c, a.sons[L-1]) of nkTypeSection, nkConstSection: for i in countup(0, sonsLen(n) - 1): let a = n.sons[i] |