mirror of https://github.com/m-labs/artiq.git
transform/tools/value_to_ast: support floats
This commit is contained in:
parent
f061b15994
commit
dc38356ad9
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue