merged the persistent scopes work with the delayed proc compilation strategy
This commit is contained in:
commit
14b5d5f262
12 changed files with 93 additions and 42 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue