macros.nim: added missing pairs iterator
This commit is contained in:
parent
14e236af05
commit
0be71677d9
1 changed files with 5 additions and 0 deletions
|
|
@ -986,6 +986,11 @@ iterator items*(n: NimNode): NimNode {.inline.} =
|
|||
for i in 0 ..< n.len:
|
||||
yield n[i]
|
||||
|
||||
iterator pairs*(n: NimNode): (int, NimNode) {.inline.} =
|
||||
## Iterates over the children of the NimNode ``n`` and its indices.
|
||||
for i in 0 ..< n.len:
|
||||
yield (i, n[i])
|
||||
|
||||
iterator children*(n: NimNode): NimNode {.inline.} =
|
||||
## Iterates over the children of the NimNode ``n``.
|
||||
for i in 0 ..< n.len:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue