Renamed considerAccents to considerQuotedIdent

This commit is contained in:
Clay Sweetser 2014-05-26 10:42:10 -04:00
commit 10e23e9159
11 changed files with 31 additions and 31 deletions

View file

@ -15,7 +15,7 @@ import
proc ensureNoMissingOrUnusedSymbols(scope: PScope)
proc considerAccents*(n: PNode): PIdent =
proc considerQuotedIdent*(n: PNode): PIdent =
## Retrieve a PIdent from a PNode, taking into account accent nodes.
case n.kind
of nkIdent: result = n.ident
@ -23,7 +23,7 @@ proc considerAccents*(n: PNode): PIdent =
of nkAccQuoted:
case n.len
of 0: globalError(n.info, errIdentifierExpected, renderTree(n))
of 1: result = considerAccents(n.sons[0])
of 1: result = considerQuotedIdent(n.sons[0])
else:
var id = ""
for i in 0.. <n.len:
@ -83,10 +83,10 @@ proc searchInScopes*(c: PContext, s: PIdent, filter: TSymKinds): PSym =
proc errorSym*(c: PContext, n: PNode): PSym =
## creates an error symbol to avoid cascading errors (for IDE support)
var m = n
# ensure that 'considerAccents' can't fail:
# ensure that 'considerQuotedIdent' can't fail:
if m.kind == nkDotExpr: m = m.sons[1]
let ident = if m.kind in {nkIdent, nkSym, nkAccQuoted}:
considerAccents(m)
considerQuotedIdent(m)
else:
getIdent("err:" & renderTree(m))
result = newSym(skError, ident, getCurrOwner(), n.info)
@ -190,7 +190,7 @@ proc lookUp*(c: PContext, n: PNode): PSym =
of nkSym:
result = n.sym
of nkAccQuoted:
var ident = considerAccents(n)
var ident = considerQuotedIdent(n)
result = searchInScopes(c, ident)
if result == nil:
localError(n.info, errUndeclaredIdentifier, ident.s)
@ -209,7 +209,7 @@ type
proc qualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym =
case n.kind
of nkIdent, nkAccQuoted:
var ident = considerAccents(n)
var ident = considerQuotedIdent(n)
result = searchInScopes(c, ident)
if result == nil and checkUndeclared in flags:
localError(n.info, errUndeclaredIdentifier, ident.s)
@ -229,7 +229,7 @@ proc qualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym =
if n.sons[1].kind == nkIdent:
ident = n.sons[1].ident
elif n.sons[1].kind == nkAccQuoted:
ident = considerAccents(n.sons[1])
ident = considerQuotedIdent(n.sons[1])
if ident != nil:
if m == c.module:
result = strTableGet(c.topLevelScope.symbols, ident)
@ -252,7 +252,7 @@ proc qualifiedLookUp*(c: PContext, n: PNode, flags = {checkUndeclared}): PSym =
proc initOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym =
case n.kind
of nkIdent, nkAccQuoted:
var ident = considerAccents(n)
var ident = considerQuotedIdent(n)
o.scope = c.currentScope
o.mode = oimNoQualifier
while true:
@ -273,7 +273,7 @@ proc initOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym =
if n.sons[1].kind == nkIdent:
ident = n.sons[1].ident
elif n.sons[1].kind == nkAccQuoted:
ident = considerAccents(n.sons[1])
ident = considerQuotedIdent(n.sons[1])
if ident != nil:
if o.m == c.module:
# a module may access its private members:
@ -355,5 +355,5 @@ when false:
if sfImmediate in a.flags: return a
a = nextOverloadIter(o, c, n)
if result == nil and checkUndeclared in flags:
localError(n.info, errUndeclaredIdentifier, n.considerAccents.s)
localError(n.info, errUndeclaredIdentifier, n.considerQuotedIdent.s)
result = errorSym(c, n)