2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

transforms/tools/eval_constant: fix int64 handling

This commit is contained in:
Sebastien Bourdeauducq 2014-10-29 17:30:35 +08:00
parent 70cc0d1766
commit c82c631a1d

View File

@ -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)