summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r--compiler/semdata.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 20fd1d9be..845efd25a 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -39,6 +39,7 @@ type
     next*: PProcCon           # used for stacking procedure contexts
     wasForwarded*: bool       # whether the current proc has a separate header
     bracketExpr*: PNode       # current bracket expression (for ^ support)
+    mapping*: TIdTable
 
   TInstantiationPair* = object
     genericSym*: PSym
@@ -147,6 +148,15 @@ proc lastOptionEntry*(c: PContext): POptionEntry =
 
 proc popProcCon*(c: PContext) {.inline.} = c.p = c.p.next
 
+proc put*(p: PProcCon; key, val: PSym) =
+  if p.mapping.data == nil: initIdTable(p.mapping)
+  #echo "put into table ", key.info
+  p.mapping.idTablePut(key, val)
+
+proc get*(p: PProcCon; key: PSym): PSym =
+  if p.mapping.data == nil: return nil
+  result = PSym(p.mapping.idTableGet(key))
+
 proc newOptionEntry*(): POptionEntry =
   new(result)
   result.options = gOptions