From 1e654f5da29837b3704ac039a81d89f810c1a2c9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Aug 2014 21:31:56 +0800 Subject: [PATCH] compiler/tools: support int64 in value_to_ast --- artiq/compiler/tools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/tools.py b/artiq/compiler/tools.py index d66e5abe9..be97319c8 100644 --- a/artiq/compiler/tools.py +++ b/artiq/compiler/tools.py @@ -12,7 +12,12 @@ def eval_ast(expr, symdict=dict()): return eval(code, symdict) def value_to_ast(value): - if isinstance(value, int): + if isinstance(value, core_language.int64): # must be before int + return ast.Call( + func=ast.Name("int64", ast.Load()), + args=[ast.Num(int(value))], + keywords=[], starargs=None, kwargs=None) + elif isinstance(value, int): return ast.Num(value) elif isinstance(value, Fraction): return ast.Call(func=ast.Name("Fraction", ast.Load()),