diff options
author | Araq <rumpf_a@web.de> | 2017-02-16 00:43:14 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-02-16 11:15:43 +0100 |
commit | 71026cec6e28d89677be0b5b3db4f8f79ee4bb3e (patch) | |
tree | 73bdf98c023f3f13b93ace22a63e1bb47035a213 /compiler/semdata.nim | |
parent | 8de6c39f87be3afa0b997a80b9124e42e4741d73 (diff) | |
download | Nim-71026cec6e28d89677be0b5b3db4f8f79ee4bb3e.tar.gz |
fixes #5383
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r-- | compiler/semdata.nim | 10 |
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 |