# HG changeset patch # User paulb@jeremy # Date 1152988832 -7200 # Node ID f610d9fa8dab472581ddcbedbd9616e39d73edba # Parent 7c40ee4eea88ab47468bddfb62e64b3d70cdca9f Fixed Compare and usage of args (instead of params) in Invoke nodes. Removed irrelevant annotation note from Node. diff -r 7c40ee4eea88 -r f610d9fa8dab simplified.py --- a/simplified.py Sat Jul 15 19:54:55 2006 +0200 +++ b/simplified.py Sat Jul 15 20:40:32 2006 +0200 @@ -27,7 +27,6 @@ A result node with common attributes: original The original node from which this node was created. - statements Any underlying statements. expr Any contributing expression. name Any name involved (variable or attribute). code Any code grouped by this node. diff -r 7c40ee4eea88 -r f610d9fa8dab simplify.py --- a/simplify.py Sat Jul 15 19:54:55 2006 +0200 +++ b/simplify.py Sat Jul 15 20:40:32 2006 +0200 @@ -218,11 +218,11 @@ expr = self.dispatch(node) method_name = self.comparison_methods[op_name] if method_name: - invocation = Invoke(expr=LoadAttr(expr=previous, name=method_name), params=[expr], star=None, dstar=None) + invocation = Invoke(expr=LoadAttr(expr=previous, name=method_name), args=[expr], star=None, dstar=None) elif op_name == "is": - invocation = Invoke(expr=LoadName(name="__is__"), params=[previous, expr], star=None, dstar=None) + invocation = Invoke(expr=LoadName(name="__is__"), args=[previous, expr], star=None, dstar=None) elif op_name == "is not": - invocation = Not(expr=Invoke(expr=LoadName(name="__is__"), params=[previous, expr], star=None, dstar=None)) + invocation = Not(expr=Invoke(expr=LoadName(name="__is__"), args=[previous, expr], star=None, dstar=None)) else: raise NotImplementedError, op_name nodes.append(StoreTemp(expr=invocation)) @@ -231,6 +231,7 @@ nodes.append(ReleaseTemp()) else: nodes.append(Return(expr=LoadTemp())) + previous = expr subprogram.code = nodes self.current_subprograms.pop() @@ -259,7 +260,7 @@ expr = self.dispatch(node) if node is not last: nodes.append(StoreTemp(expr=expr)) - invocation = Invoke(expr=LoadAttr(expr=LoadTemp(), name="__true__"), params=[], star=None, dstar=None) + invocation = Invoke(expr=LoadAttr(expr=LoadTemp(), name="__true__"), args=[], star=None, dstar=None) nodes.append(Conditional(test=Not(expr=invocation), body=[Return(expr=LoadTemp())])) nodes.append(ReleaseTemp()) else: @@ -292,8 +293,7 @@ expr = self.dispatch(node) if node is not last: nodes.append(StoreTemp(expr=expr)) - invocation = Invoke(expr=LoadAttr(expr=LoadTemp(), name="__true__"), - params=[], star=None, dstar=None) + invocation = Invoke(expr=LoadAttr(expr=LoadTemp(), name="__true__"), args=[], star=None, dstar=None) nodes.append(Conditional(test=invocation, body=[Return(expr=LoadTemp())])) nodes.append(ReleaseTemp()) else: @@ -311,7 +311,7 @@ def visitNot(self, not_): result = Not(not_, expr=Invoke(expr=LoadAttr(expr=self.dispatch(not_.expr), name="__true__"), - params=[], star=None, dstar=None)) + args=[], star=None, dstar=None)) return result # Operators. diff -r 7c40ee4eea88 -r f610d9fa8dab tests/compare.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/compare.py Sat Jul 15 20:40:32 2006 +0200 @@ -0,0 +1,1 @@ +a != b < c.d > e