diff options
Diffstat (limited to 'compiler/ast.nim')
-rwxr-xr-x | compiler/ast.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 669b45159..ff493e563 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -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 |