mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
macros.nim: added missing pairs iterator
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user