merged the persistent scopes work with the delayed proc compilation strategy

This commit is contained in:
Zahary Karadjov 2013-05-12 14:41:32 +03:00
commit 14b5d5f262
12 changed files with 93 additions and 42 deletions

View file

@ -45,15 +45,13 @@ proc addUniqueSym*(scope: PScope, s: PSym): TResult =
result = Success
proc openScope*(c: PContext): PScope {.discardable.} =
inc c.scopeDepth
result = PScope(parent: c.currentScope,
symbols: newStrTable(),
depthLevel: c.scopeDepth)
depthLevel: c.scopeDepth + 1)
c.currentScope = result
proc rawCloseScope*(c: PContext) =
c.currentScope = c.currentScope.parent
dec c.scopeDepth
proc closeScope*(c: PContext) =
ensureNoMissingOrUnusedSymbols(c.currentScope)