Merge branch 'macro-items' of https://github.com/transfuturist/Nim into transfuturist-macro-items
This commit is contained in:
commit
04dc46b1aa
1 changed files with 3 additions and 1 deletions
|
|
@ -719,10 +719,12 @@ proc `$`*(node: NimNode): string {.compileTime.} =
|
||||||
proc ident*(name: string): NimNode {.compileTime,inline.} = newIdentNode(name)
|
proc ident*(name: string): NimNode {.compileTime,inline.} = newIdentNode(name)
|
||||||
## Create a new ident node from a string
|
## Create a new ident node from a string
|
||||||
|
|
||||||
iterator children*(n: NimNode): NimNode {.inline.}=
|
iterator items*(n: NimNode): NimNode {.inline.} =
|
||||||
for i in 0 ..< n.len:
|
for i in 0 ..< n.len:
|
||||||
yield n[i]
|
yield n[i]
|
||||||
|
|
||||||
|
iterator children*(n: NimNode): NimNode {.inline.} = items
|
||||||
|
|
||||||
template findChild*(n: NimNode; cond: expr): NimNode {.
|
template findChild*(n: NimNode; cond: expr): NimNode {.
|
||||||
immediate, dirty.} =
|
immediate, dirty.} =
|
||||||
## Find the first child node matching condition (or nil).
|
## Find the first child node matching condition (or nil).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue