transf: big refactoring; other small fixes
This commit is contained in:
parent
63ac32e6de
commit
5635fde060
11 changed files with 286 additions and 225 deletions
|
|
@ -955,9 +955,9 @@ proc hasSubnodeWith(n: PNode, kind: TNodeKind): bool =
|
|||
of nkEmpty..nkNilLit: result = n.kind == kind
|
||||
else:
|
||||
for i in countup(0, sonsLen(n) - 1):
|
||||
if (n.sons[i] != nil) and (n.sons[i].kind == kind) or
|
||||
hasSubnodeWith(n.sons[i], kind):
|
||||
return true
|
||||
if n.sons[i] != nil:
|
||||
if (n.sons[i].kind == kind) or hasSubnodeWith(n.sons[i], kind):
|
||||
return true
|
||||
result = false
|
||||
|
||||
proc replaceSons(n: PNode, oldKind, newKind: TNodeKind) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue