Compare commits

..

No commits in common. "ef7a7f55ceb96c50a9c7f75d728a5f656d4361d4" and "ab86bf459158996e181b0bf5af4fffd875113da9" have entirely different histories.

3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,10 @@
from min_artiq import *
from numpy import int32, int64
@extern
def output_int(x: int32):
...
@nac3

View File

@ -65,7 +65,6 @@ pub struct PrimitivePythonId {
uint32: u64,
uint64: u64,
float: u64,
float64: u64,
bool: u64,
list: u64,
tuple: u64,
@ -398,7 +397,6 @@ impl Nac3 {
uint64: get_attr_id(numpy_mod, "uint64"),
bool: get_attr_id(builtins_mod, "bool"),
float: get_attr_id(builtins_mod, "float"),
float64: get_attr_id(numpy_mod, "float64"),
list: get_attr_id(builtins_mod, "list"),
tuple: get_attr_id(builtins_mod, "tuple"),
exception: get_attr_id(builtins_mod, "Exception"),

View File

@ -302,8 +302,6 @@ impl InnerResolver {
Ok(Ok((primitives.bool, true)))
} else if ty_id == self.primitive_ids.float {
Ok(Ok((primitives.float, true)))
} else if ty_id == self.primitive_ids.float64 {
Ok(Ok((primitives.float, true)))
} else if ty_id == self.primitive_ids.exception {
Ok(Ok((primitives.exception, true)))
} else if ty_id == self.primitive_ids.list {
@ -757,7 +755,7 @@ impl InnerResolver {
format!("{} is not in the range of bool", obj)))?;
self.id_to_primitive.write().insert(id, PrimitiveValue::Bool(val));
Ok(Some(ctx.ctx.bool_type().const_int(val as u64, false).into()))
} else if ty_id == self.primitive_ids.float || ty_id == self.primitive_ids.float64 {
} else if ty_id == self.primitive_ids.float {
let val: f64 = obj.extract().map_err(|_| super::CompileError::new_err(
format!("{} is not in the range of float64", obj)))?;
self.id_to_primitive.write().insert(id, PrimitiveValue::F64(val));
@ -987,7 +985,7 @@ impl InnerResolver {
} else if ty_id == self.primitive_ids.bool {
let val: bool = obj.extract()?;
Ok(SymbolValue::Bool(val))
} else if ty_id == self.primitive_ids.float || ty_id == self.primitive_ids.float64 {
} else if ty_id == self.primitive_ids.float {
let val: f64 = obj.extract()?;
Ok(SymbolValue::Double(val))
} else if ty_id == self.primitive_ids.tuple {