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

@ -156,7 +156,7 @@ proc encodeNode(g: ModuleGraph; fInfo: TLineInfo, n: PNode,
encodeVInt(n.sym.id, result)
pushSym(w, n.sym)
else:
for i in 0 ..< sonsLen(n):
for i in 0 ..< len(n):
encodeNode(g, n.info, n.sons[i], result)
add(result, ')')
@ -244,7 +244,7 @@ proc encodeType(g: ModuleGraph, t: PType, result: var string) =
add(result, '\21')
encodeVInt(t.typeInst.uniqueId, result)
pushType(w, t.typeInst)
for i in 0 ..< sonsLen(t):
for i in 0 ..< len(t):
if t.sons[i] == nil:
add(result, "^()")
else: