1.1 --- a/micropython/ast.py Sat Feb 09 02:35:57 2008 +0100
1.2 +++ b/micropython/ast.py Sat Feb 09 19:37:38 2008 +0100
1.3 @@ -142,7 +142,7 @@
1.4 if scope == "local":
1.5 unit = self.unit
1.6 if isinstance(unit, micropython.inspect.Function):
1.7 - self.new_op(NameInstruction(unit.locals()[name]))
1.8 + self.new_op(NameInstruction(unit.all_locals()[name]))
1.9 elif isinstance(unit, micropython.inspect.Class):
1.10 self.new_op(AttrInstruction(unit.all_class_attributes()[name]))
1.11 elif isinstance(unit, micropython.inspect.Module):
1.12 @@ -269,7 +269,11 @@
1.13
1.14 self.new_op(DropFrame())
1.15
1.16 - def visitClass(self, node): pass
1.17 + def visitClass(self, node):
1.18 + unit = self.unit
1.19 + self.unit = node.cls
1.20 + self.dispatch(node.code)
1.21 + self.unit = unit
1.22
1.23 def visitCompare(self, node):
1.24