Merge branch 'macro-items' of https://github.com/transfuturist/Nim into transfuturist-macro-items

This commit is contained in:
Dominik Picheta
2015-08-03 17:03:57 +01:00

View File

@@ -719,10 +719,12 @@ proc `$`*(node: NimNode): string {.compileTime.} =
proc ident*(name: string): NimNode {.compileTime,inline.} = newIdentNode(name)
## 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:
yield n[i]
iterator children*(n: NimNode): NimNode {.inline.} = items
template findChild*(n: NimNode; cond: expr): NimNode {.
immediate, dirty.} =
## Find the first child node matching condition (or nil).