From c82c631a1de537bcff7f6cb17f889ec8565aa060 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 29 Oct 2014 17:30:35 +0800 Subject: [PATCH] transforms/tools/eval_constant: fix int64 handling --- artiq/transforms/tools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/transforms/tools.py b/artiq/transforms/tools.py index 085a23a14..2b3bbdbf3 100644 --- a/artiq/transforms/tools.py +++ b/artiq/transforms/tools.py @@ -57,7 +57,9 @@ def eval_constant(node): return node.value elif isinstance(node, ast.Call): funcname = node.func.id - if funcname == "Fraction": + if funcname == "int64": + return core_language.int64(eval_constant(node.args[0])) + elif funcname == "Fraction": numerator = eval_constant(node.args[0]) denominator = eval_constant(node.args[1]) return Fraction(numerator, denominator)