NimNode needs an items iterator to be used nicely in for statements
This commit is contained in:
parent
4ac0804187
commit
939c0a6bb8
1 changed files with 4 additions and 0 deletions
|
|
@ -712,6 +712,10 @@ iterator children*(n: NimNode): NimNode {.inline.}=
|
|||
for i in 0 .. high(n):
|
||||
yield n[i]
|
||||
|
||||
iterator items*(n: NimNode): NimNode {.inline.}=
|
||||
for i in 0 .. high(n):
|
||||
yield n[i]
|
||||
|
||||
template findChild*(n: NimNode; cond: expr): NimNode {.
|
||||
immediate, dirty.} =
|
||||
## Find the first child node matching condition (or nil).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue