1.1 --- a/micropython/__init__.py Thu Nov 15 22:27:44 2012 +0100
1.2 +++ b/micropython/__init__.py Fri Nov 16 00:29:15 2012 +0100
1.3 @@ -89,6 +89,7 @@
1.4 # A record of nodes for which no attribute target could be found.
1.5
1.6 self.unknown_target_nodes = []
1.7 + self.independent_target_nodes = []
1.8
1.9 def get_importer(self):
1.10 return self.importer
2.1 --- a/micropython/report.py Thu Nov 15 22:27:44 2012 +0100
2.2 +++ b/micropython/report.py Fri Nov 16 00:29:15 2012 +0100
2.3 @@ -1059,6 +1059,7 @@
2.4 if not possible_types:
2.5 possible_types = self._get_possible_types(node.attrname)
2.6
2.7 + self.record_unknown_targets(possible_types, deduced, node)
2.8 attributes = self._get_attributes(possible_types, node.attrname)
2.9
2.10 wraps_getattr = self._has_descendant(node.expr, compiler.ast.Getattr)
2.11 @@ -1165,6 +1166,7 @@
2.12 if not possible_types:
2.13 possible_types = self._get_possible_types(node.attrname)
2.14
2.15 + self.record_unknown_targets(possible_types, deduced, node)
2.16 attributes = self._get_attributes(possible_types, node.attrname)
2.17
2.18 wraps_getattr = self._has_descendant(node.expr, compiler.ast.Getattr)
2.19 @@ -1457,10 +1459,13 @@
2.20 # Statistics gathering methods.
2.21
2.22 def possible_accessor_types(self, node, defining_users=1):
2.23 - possible_types = set([tn for (tn, st) in ASTVisitor.possible_accessor_types(self, node, defining_users)])
2.24 + return set([tn for (tn, st) in ASTVisitor.possible_accessor_types(self, node, defining_users)])
2.25 +
2.26 + def record_unknown_targets(self, possible_types, deduced, node):
2.27 if not possible_types:
2.28 self.program.unknown_target_nodes.append((self.units[-1], node))
2.29 - return possible_types
2.30 + elif not deduced:
2.31 + self.program.independent_target_nodes.append((self.units[-1], node))
2.32
2.33 # Utility methods.
2.34