diff options
author | Dominik Picheta <dominikp@kainos.com> | 2015-08-03 17:03:57 +0100 |
---|---|---|
committer | Dominik Picheta <dominikp@kainos.com> | 2015-08-03 17:03:57 +0100 |
commit | 04dc46b1aa76da615d175fecc9c6cc1bc5075f18 (patch) | |
tree | 937d835a7230d9bc0b2eaca95a783b429db6e58e /lib/core/macros.nim | |
parent | e1913abdd4a397ad21aa2452c75e82e163df0c20 (diff) | |
parent | 558360e6fdf73de27f2bf9631124288c4db4d8fb (diff) | |
download | Nim-04dc46b1aa76da615d175fecc9c6cc1bc5075f18.tar.gz |
Merge branch 'macro-items' of https://github.com/transfuturist/Nim into transfuturist-macro-items
Diffstat (limited to 'lib/core/macros.nim')
-rw-r--r-- | lib/core/macros.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index c89fa354a..d9e89e7f1 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -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). |