diff options
author | Andreas Rumpf <andreasrumpf@noname> | 2009-09-15 23:22:22 +0200 |
---|---|---|
committer | Andreas Rumpf <andreasrumpf@noname> | 2009-09-15 23:22:22 +0200 |
commit | 66a7e3d37c0303997a6b1a3b7ec263dfb8c07748 (patch) | |
tree | 40ae1ab8aeb9086b7310ea73ab8a2ed6b597f88b /nim/lookups.pas | |
parent | 300430fbba28b408f7ac86ca46b03d9d50839399 (diff) | |
download | Nim-66a7e3d37c0303997a6b1a3b7ec263dfb8c07748.tar.gz |
added tools and web dirs
Diffstat (limited to 'nim/lookups.pas')
-rwxr-xr-x[-rw-r--r--] | nim/lookups.pas | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nim/lookups.pas b/nim/lookups.pas index d106ef302..5caceaf46 100644..100755 --- a/nim/lookups.pas +++ b/nim/lookups.pas @@ -72,7 +72,7 @@ begin liMessage(s.info, errImplOfXexpected, getSymRepr(s)) else if ([sfUsed, sfInInterface] * s.flags = []) and (optHints in s.options) then // BUGFIX: check options in s! - if not (s.kind in [skForVar, skParam]) then + if not (s.kind in [skForVar, skParam, skUnknown]) then liMessage(s.info, hintXDeclaredButNotUsed, getSymRepr(s)); s := NextIter(it, tab.stack[tab.tos-1]); end; @@ -103,7 +103,7 @@ begin if not (fn.kind in OverloadableSyms) then InternalError(fn.info, 'addOverloadableSymAt'); check := StrTableGet(c.tab.stack[at], fn.name); - if (check <> nil) and (check.Kind <> fn.kind) then + if (check <> nil) and not (check.Kind in OverloadableSyms) then liMessage(fn.info, errAttemptToRedefine, fn.Name.s); SymTabAddAt(c.tab, fn, at); end; @@ -136,17 +136,16 @@ function lookUp(c: PContext; n: PNode): PSym; begin case n.kind of nkAccQuoted: result := lookup(c, n.sons[0]); - nkSym: begin + nkSym: begin (* result := SymtabGet(c.Tab, n.sym.name); if result = nil then - liMessage(n.info, errUndeclaredIdentifier, n.sym.name.s); - //include(result.flags, sfUsed); + liMessage(n.info, errUndeclaredIdentifier, n.sym.name.s); *) + result := n.sym; end; nkIdent: begin result := SymtabGet(c.Tab, n.ident); if result = nil then liMessage(n.info, errUndeclaredIdentifier, n.ident.s); - //include(result.flags, sfUsed); end else InternalError(n.info, 'lookUp'); end; @@ -169,12 +168,13 @@ begin and IntSetContains(c.AmbiguousSymbols, result.id) then liMessage(n.info, errUseQualifier, n.ident.s) end; - nkSym: begin + nkSym: begin (* result := SymtabGet(c.Tab, n.sym.name); if result = nil then liMessage(n.info, errUndeclaredIdentifier, n.sym.name.s) - else if ambiguousCheck - and IntSetContains(c.AmbiguousSymbols, result.id) then + else *) + result := n.sym; + if ambiguousCheck and IntSetContains(c.AmbiguousSymbols, result.id) then liMessage(n.info, errUseQualifier, n.sym.name.s) end; nkDotExpr, nkQualified: begin |