mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
NimNode needs an items iterator to be used nicely in for statements
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user