This commit is contained in:
Araq 2017-02-16 00:43:14 +01:00
commit 97e26967f1
11 changed files with 60 additions and 17 deletions

View file

@ -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