public DataType VisitSuite(SuiteStatement b)
{
// first pass: mark global names
var globalNames = b.stmts
.OfType <GlobalStatement>()
.SelectMany(g => g.names)
.Concat(b.stmts
.OfType <NonlocalStatement>()
.SelectMany(g => g.names));
foreach (var id in globalNames)
{
scope.AddGlobalName(id.Name);
ISet <Binding> nb = scope.Lookup(id.Name);
if (nb != null)
{
analyzer.putRef(id, nb);
}
}
bool returned = false;
DataType retType = DataType.Unknown;
foreach (var n in b.stmts)
{
DataType t = n.Accept(this);
if (!returned)
{
retType = UnionType.Union(retType, t);
if (!UnionType.Contains(t, DataType.Cont))
{
returned = true;
retType = UnionType.remove(retType, DataType.Cont);
}
}
}
return(retType);
}