1.1 --- a/simplify.py Tue Nov 28 00:37:12 2006 +0100
1.2 +++ b/simplify.py Fri Dec 01 00:32:06 2006 +0100
1.3 @@ -49,15 +49,14 @@
1.4
1.5 Covered: Add, And, AssAttr, AssList, AssName, AssTuple, Assign, AugAssign,
1.6 Break, CallFunc, Class, Compare, Const, Continue, Dict, Discard,
1.7 - For, From, Function, Getattr, Global, If, Import, Invert, Keyword,
1.8 - Lambda, List, Module, Name, Not, Or, Pass, Raise, Return, Slice,
1.9 - Stmt, Subscript, TryExcept, TryFinally, Tuple, While, UnaryAdd,
1.10 - UnarySub.
1.11 + Div, FloorDiv, For, From, Function, Getattr, Global, If, Import,
1.12 + Invert, Keyword, Lambda, List, Module, Mul, Name, Not, Or, Pass,
1.13 + Raise, Return, Slice, Stmt, Sub, Subscript, TryExcept, TryFinally,
1.14 + Tuple, While, UnaryAdd, UnarySub.
1.15
1.16 - Missing: Assert, Backquote, Bitand, Bitor, Bitxor, Decorators, Div,
1.17 - Ellipsis, Exec, FloorDiv, LeftShift, ListComp, ListCompFor,
1.18 - ListCompIf, Mod, Mul, Power, Print, Printnl, RightShift, Sliceobj,
1.19 - Sub, Yield.
1.20 + Missing: Assert, Backquote, Bitand, Bitor, Bitxor, Decorators, Ellipsis,
1.21 + Exec, LeftShift, ListComp, ListCompFor, ListCompIf,
1.22 + Power, Print, Printnl, RightShift, Sliceobj, Yield.
1.23 """
1.24
1.25 def __init__(self, builtins=0):
1.26 @@ -716,6 +715,9 @@
1.27 )
1.28 ]
1.29
1.30 + self.current_subprograms.pop()
1.31 + self.subprograms.append(subprogram); self.subnames[subprogram.full_name()] = subprogram
1.32 +
1.33 result = InvokeBlock(produces_result=1)
1.34 result.expr = LoadRef(ref=subprogram)
1.35 return result
1.36 @@ -726,6 +728,9 @@
1.37 def visitDiv(self, div):
1.38 return self._visitBinary(div, "__div__", "__rdiv__")
1.39
1.40 + def visitFloorDiv(self, floordiv):
1.41 + return self._visitBinary(floordiv, "__floordiv__", "__rfloordiv__")
1.42 +
1.43 def visitMul(self, mul):
1.44 return self._visitBinary(mul, "__mul__", "__rmul__")
1.45