This commit is contained in:
Paul Tagliamonte 2012-12-22 14:43:20 -05:00
parent cb0d6d45f9
commit 7b68b34f53

View File

@ -25,10 +25,18 @@ def _ast_print(node, children):
def _ast_binop(node, children):
# operator = Add | Sub | Mult | Div | Mod | Pow | LShift
# | RShift | BitOr | BitXor | BitAnd | FloorDiv
# XXX: Add these folks in
inv = node.get_invocation()
ops = {
"+": ast.Add
"+": ast.Add,
"/": ast.Div,
"*": ast.Mult,
"-": ast.Sub
}
op = ops[inv['function']]
left = children.pop(0)
@ -42,7 +50,10 @@ def _ast_binop(node, children):
special_cases = {
"print": _ast_print,
"+": _ast_binop
"+": _ast_binop,
"/": _ast_binop,
"-": _ast_binop,
"*": _ast_binop
}