1.1 --- a/micropython/ast.py Sun Jul 12 03:28:40 2009 +0200
1.2 +++ b/micropython/ast.py Sun Jul 12 03:31:48 2009 +0200
1.3 @@ -546,7 +546,7 @@
1.4 self.discard_temp(temp2)
1.5
1.6 def visitClass(self, node):
1.7 - if not node.unit.referenced:
1.8 + if not node.unit.parent.has_key(node.unit.name):
1.9 return
1.10
1.11 # Store the name.
1.12 @@ -569,7 +569,7 @@
1.13 def visitFrom(self, node): pass
1.14
1.15 def visitFunction(self, node):
1.16 - if not node.unit.referenced and (not node.unit.is_method() or not node.unit.parent.has_key(node.unit.name)):
1.17 + if not node.unit.parent.has_key(node.unit.name):
1.18 return
1.19
1.20 # Only store the name when visiting this node from outside.