next steps for closure consistency; fixes #176

This commit is contained in:
Araq 2012-07-25 21:59:31 +02:00
commit 20b6dc3829
9 changed files with 495 additions and 9 deletions

View file

@ -1092,6 +1092,14 @@ proc hasSonWith(n: PNode, kind: TNodeKind): bool =
return true
result = false
proc hasNilSon*(n: PNode): bool =
for i in countup(0, safeLen(n) - 1):
if n.sons[i] == nil:
return true
elif hasNilSon(n.sons[i]):
return true
result = false
proc containsNode*(n: PNode, kinds: TNodeKinds): bool =
if n == nil: return
case n.kind