2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

transform/tools/value_to_ast: support floats

This commit is contained in:
Sebastien Bourdeauducq 2014-09-16 23:11:53 +08:00
parent f061b15994
commit dc38356ad9

View File

@ -19,7 +19,7 @@ def value_to_ast(value):
func=ast.Name("int64", ast.Load()),
args=[ast.Num(int(value))],
keywords=[], starargs=None, kwargs=None)
elif isinstance(value, int):
elif isinstance(value, (int, float)):
return ast.Num(value)
elif isinstance(value, Fraction):
return ast.Call(