1.1 --- a/annotate.py Mon Oct 30 23:33:58 2006 +0100
1.2 +++ b/annotate.py Tue Oct 31 00:44:10 2006 +0100
1.3 @@ -294,14 +294,13 @@
1.4 def visitLoadAttr(self, loadattr):
1.5 loadattr.expr = self.dispatch(loadattr.expr)
1.6 types = []
1.7 - non_types = []
1.8 + non_accesses = []
1.9 accesses = {}
1.10 for attr in self.namespace.types:
1.11 attributes = get_attributes(attr.type, loadattr.name)
1.12 if not attributes:
1.13 - print "No attributes for", loadattr.name, "in", attr.type
1.14 - if not attr.type in non_types:
1.15 - non_types.append(attr)
1.16 + if not attr.type in non_accesses:
1.17 + non_accesses.append(attr)
1.18 for attribute, accessor in attributes:
1.19 if attribute is not None:
1.20 types.append(attribute)
1.21 @@ -310,11 +309,12 @@
1.22 if not (attribute, accessor) in accesses[attr.type]:
1.23 accesses[attr.type].append((attribute, accessor))
1.24 else:
1.25 - print "Empty attribute", loadattr.name, "via accessor", accessor
1.26 - if not attr.type in non_types:
1.27 - non_types.append(attr)
1.28 + if not attr.type in non_accesses:
1.29 + non_accesses.append(attr)
1.30 + if not types:
1.31 + print "No attribute found for", loadattr.name, "given", self.namespace.types
1.32 self.namespace.set_types(types)
1.33 - loadattr.non_types = non_types
1.34 + loadattr.non_accesses = non_accesses
1.35 loadattr.accesses = accesses
1.36 self.annotate(loadattr)
1.37 return loadattr