Cleanup lookups.nim again.. (#18379)
This commit is contained in:
parent
72d6a9c885
commit
dd2cbe3164
1 changed files with 4 additions and 4 deletions
|
|
@ -58,8 +58,8 @@ proc considerQuotedIdent*(c: PContext; n: PNode, origin: PNode = nil): PIdent =
|
||||||
template addSym*(scope: PScope, s: PSym) =
|
template addSym*(scope: PScope, s: PSym) =
|
||||||
strTableAdd(scope.symbols, s)
|
strTableAdd(scope.symbols, s)
|
||||||
|
|
||||||
proc addUniqueSym*(scope: PScope, s: PSym, onConflictKeepOld: bool): PSym =
|
proc addUniqueSym*(scope: PScope, s: PSym): PSym =
|
||||||
result = strTableInclReportConflict(scope.symbols, s, onConflictKeepOld)
|
result = strTableInclReportConflict(scope.symbols, s)
|
||||||
|
|
||||||
proc openScope*(c: PContext): PScope {.discardable.} =
|
proc openScope*(c: PContext): PScope {.discardable.} =
|
||||||
result = PScope(parent: c.currentScope,
|
result = PScope(parent: c.currentScope,
|
||||||
|
|
@ -298,7 +298,7 @@ proc wrongRedefinition*(c: PContext; info: TLineInfo, s: string;
|
||||||
# xxx pending bootstrap >= 1.4, replace all those overloads with a single one:
|
# xxx pending bootstrap >= 1.4, replace all those overloads with a single one:
|
||||||
# proc addDecl*(c: PContext, sym: PSym, info = sym.info, scope = c.currentScope) {.inline.} =
|
# proc addDecl*(c: PContext, sym: PSym, info = sym.info, scope = c.currentScope) {.inline.} =
|
||||||
proc addDeclAt*(c: PContext; scope: PScope, sym: PSym, info: TLineInfo) =
|
proc addDeclAt*(c: PContext; scope: PScope, sym: PSym, info: TLineInfo) =
|
||||||
let conflict = scope.addUniqueSym(sym, onConflictKeepOld = true)
|
let conflict = scope.addUniqueSym(sym)
|
||||||
if conflict != nil:
|
if conflict != nil:
|
||||||
if sym.kind == skModule and conflict.kind == skModule and sym.owner == conflict.owner:
|
if sym.kind == skModule and conflict.kind == skModule and sym.owner == conflict.owner:
|
||||||
# e.g.: import foo; import foo
|
# e.g.: import foo; import foo
|
||||||
|
|
@ -320,7 +320,7 @@ proc addDecl*(c: PContext, sym: PSym) {.inline.} =
|
||||||
addDeclAt(c, c.currentScope, sym)
|
addDeclAt(c, c.currentScope, sym)
|
||||||
|
|
||||||
proc addPrelimDecl*(c: PContext, sym: PSym) =
|
proc addPrelimDecl*(c: PContext, sym: PSym) =
|
||||||
discard c.currentScope.addUniqueSym(sym, onConflictKeepOld = false)
|
discard c.currentScope.addUniqueSym(sym)
|
||||||
|
|
||||||
from ic / ic import addHidden
|
from ic / ic import addHidden
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue