Merge commit 'origin/1.3'

This commit is contained in:
con
2009-10-13 17:29:47 +02:00
82 changed files with 3931 additions and 1940 deletions

View File

@@ -208,6 +208,21 @@ void Scope::enterSymbol(Symbol *symbol)
}
}
Symbol *Scope::lookat(Name *name) const
{
if (! name)
return 0;
else if (OperatorNameId *opId = name->asOperatorNameId())
return lookat(opId->kind());
else if (Identifier *id = name->identifier())
return lookat(id);
else
return 0;
}
Symbol *Scope::lookat(Identifier *id) const
{
if (! _hash || ! id)

View File

@@ -129,6 +129,7 @@ public:
/// Returns the last Symbol in the scope.
iterator lastSymbol() const;
Symbol *lookat(Name *name) const;
Symbol *lookat(Identifier *id) const;
Symbol *lookat(int operatorId) const;

View File

@@ -314,6 +314,14 @@ void Symbol::setScope(Scope *scope)
_scope = scope;
}
Symbol *Symbol::enclosingSymbol() const
{
if (! _scope)
return 0;
return _scope->owner();
}
Scope *Symbol::enclosingNamespaceScope() const
{
if (! _scope)

View File

@@ -281,6 +281,8 @@ public:
bool isGenerated() const;
Symbol *enclosingSymbol() const;
/// Returns the eclosing namespace scope.
Scope *enclosingNamespaceScope() const;