From 7b68b34f5342f662971c85f905d0a35bba2f66bb Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Sat, 22 Dec 2012 14:43:20 -0500 Subject: [PATCH] foo --- hy/compiler/ast27.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hy/compiler/ast27.py b/hy/compiler/ast27.py index 63da4d0..5a34207 100644 --- a/hy/compiler/ast27.py +++ b/hy/compiler/ast27.py @@ -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 }