*
* @return the ASScope for this node, or null if there isn't one.
*/
public ASScope getASScope()
{
IScopedNode scopeNode = getContainingScope();
IASScope scope = scopeNode != null ? scopeNode.getScope() : null;
// If the ScopedNode had a null scope, keep looking up the tree until we
// find one with a non-null scope.
// TODO: Is it a bug that an IScopedNode returns null for it's scope?
// TODO: this seems like a leftover from block scoping - for example, a
// TODO: ForLoopNode is an IScopedNode, but it doesn't really have a scope
while (scope == null && scopeNode != null)
{
scopeNode = scopeNode.getContainingScope();
scope = scopeNode != null ? scopeNode.getScope() : null;
}
if (scope instanceof TypeScope)
{
TypeScope typeScope = (TypeScope)scope;