summary refs log tree commit diff stats
path: root/lib/core/macros.nim
diff options
context:
space:
mode:
authorCharles Blake <cblake@csail.mit.edu>2015-08-03 12:27:30 -0400
committerCharles Blake <cblake@csail.mit.edu>2015-08-03 12:27:30 -0400
commit7cb9f363d65d9ad3c52bf4cf35af3eb71988ac06 (patch)
tree55f8d59c37ec9dcaeaac7a9d15ea9b498929cbc2 /lib/core/macros.nim
parentc373c7209ab01ce9b2570fb0134ad52457f9ee91 (diff)
parent85699b744ddeefcb53996073168c205f00772a6d (diff)
downloadNim-7cb9f363d65d9ad3c52bf4cf35af3eb71988ac06.tar.gz
Merge ../Nim into devel
Diffstat (limited to 'lib/core/macros.nim')
-rw-r--r--lib/core/macros.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index c89fa354a..5d852cdb1 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -719,10 +719,13 @@ 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.} =
+  ## Iterates over the children of the NimNode ``n``.
   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).