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

@ -106,7 +106,7 @@ proc illegalCustomPragma*(c: PContext, n: PNode, s: PSym) =
proc pragmaAsm*(c: PContext, n: PNode): char =
result = '\0'
if n != nil:
for i in 0 ..< sonsLen(n):
for i in 0 ..< len(n):
let it = n.sons[i]
if it.kind in nkPragmaCallKinds and it.len == 2 and it.sons[0].kind == nkIdent:
case whichKeyword(it.sons[0].ident)
@ -425,7 +425,7 @@ proc processPush(c: PContext, n: PNode, start: int) =
x.notes = c.config.notes
x.features = c.features
c.optionStack.add(x)
for i in start ..< sonsLen(n):
for i in start ..< len(n):
if not tryProcessOption(c, n.sons[i], c.config.options):
# simply store it somewhere:
if x.otherPragmas.isNil: