summary refs log tree commit diff stats
path: root/compiler/astalgo.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/astalgo.nim')
-rwxr-xr-xcompiler/astalgo.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim
index 861642594..7b5c5be25 100755
--- a/compiler/astalgo.nim
+++ b/compiler/astalgo.nim
@@ -849,6 +849,10 @@ proc IdNodeTablePut(t: var TIdNodeTable, key: PIdObj, val: PNode) =
     IdNodeTableRawInsert(t.data, key, val)
     inc(t.counter)
 
+iterator pairs*(t: TIdNodeTable): tuple[key: PIdObj, val: PNode] =
+  for i in 0 .. high(t.data):
+    if not isNil(t.data[i].key): yield (t.data[i].key, t.data[i].val)
+
 proc initIITable(x: var TIITable) = 
   x.counter = 0
   newSeq(x.data, startSize)