Small ast.nim cleanup (#12156)

* Remove sonsLen
* Use Indexable
This commit is contained in:
Clyybber 2019-09-09 11:54:15 +02:00 • committed by Andreas Rumpf
commit ed1d41c51e
54 changed files with 559 additions and 573 deletions

View file

@ -16,14 +16,14 @@ proc ithField(n: PNode, field: var int): PSym =
result = nil
case n.kind
of nkRecList:
for i in 0 ..< sonsLen(n):
for i in 0 ..< len(n):
result = ithField(n.sons[i], field)
if result != nil: return
of nkRecCase:
if n.sons[0].kind != nkSym: return
result = ithField(n.sons[0], field)
if result != nil: return
for i in 1 ..< sonsLen(n):
for i in 1 ..< len(n):
case n.sons[i].kind
of nkOfBranch, nkElse:
result = ithField(lastSon(n.sons[i]), field)