# HG changeset patch # User Paul Boddie # Date 1283042457 -7200 # Node ID 495c6ac589ed02a11e66cd5427da89f51e7d2629 # Parent 70692e257878fd27b8e90e0ef3d16c89337a9832 Removed the target parameter of the _endCallFunc method. Fixed list/tuple assignment and tuple parameter support, preventing the overwriting of temporary information. diff -r 70692e257878 -r 495c6ac589ed micropython/ast.py --- a/micropython/ast.py Sun Aug 29 02:03:24 2010 +0200 +++ b/micropython/ast.py Sun Aug 29 02:40:57 2010 +0200 @@ -377,7 +377,7 @@ self.dispatch(node.node) temp_target, target, temp_context = self._generateCallFunc(node.args, node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc(temp_target, temp_context) def visitConst(self, node): const = self.importer.get_constant(node.value) @@ -432,7 +432,7 @@ self._generateAttr(node, "__getitem__", self.attribute_load_instructions) temp_target, target, temp_context = self._generateCallFunc([slice], node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc(temp_target, temp_context) def visitSubscript(self, node): self.dispatch(node.expr) @@ -440,7 +440,7 @@ self._generateAttr(node, "__getitem__", self.attribute_load_instructions) temp_target, target, temp_context = self._generateCallFunc(node.subs, node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc(temp_target, temp_context) def visitTuple(self, node): self._generateTuple(node) @@ -488,7 +488,7 @@ self.new_op(temp_getitem) temp_target, target, temp_context = self._generateCallFunc([compiler.ast.Const(i)], node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc() # Provide a different source value. # NOTE: Permitting immediate usage given that neither name nor @@ -675,7 +675,7 @@ self._generateAttr(node, "__iter__", self.attribute_load_instructions) temp_target, target, temp_context = self._generateCallFunc([], node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc(temp_target, temp_context) # Use a long-lasting temporary storage slot, since any result from the # __iter__ method will not remain around for long. @@ -697,7 +697,7 @@ self._generateAttr(node, "next", self.attribute_load_instructions) temp_target, target, temp_context = self._generateCallFunc([], node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc(temp_target, temp_context) # Record the value to be assigned. diff -r 70692e257878 -r 495c6ac589ed micropython/trans.py --- a/micropython/trans.py Sun Aug 29 02:03:24 2010 +0200 +++ b/micropython/trans.py Sun Aug 29 02:40:57 2010 +0200 @@ -996,7 +996,7 @@ self.frame_makers[-1].attr = nargs self.frame_makers.pop() - def _endCallFunc(self, temp_target=None, target=None, temp_context=None, load_result=1): + def _endCallFunc(self, temp_target=None, temp_context=None, load_result=1): "Finish the invocation and tidy up afterwards." @@ -1139,7 +1139,7 @@ self.new_op(temp_getitem) temp_target, target, temp_context = self._generateCallFunc([compiler.ast.Const(i)], node) self._doCallFunc(temp_target, target) - self._endCallFunc(temp_target, target, temp_context) + self._endCallFunc() # Where a tuple is the target, attempt to descend into the value # obtained.