Backup commit before crunch

This commit is contained in:
2023-05-16 18:32:25 +01:00
parent 33413b2b0f
commit 126494c63f
59 changed files with 847 additions and 236 deletions

View File

@@ -34,12 +34,14 @@ externfn_impl!(Equals1, |this: &Self, x: ExprInst| {
#[derive(Debug, Clone)]
pub struct Equals0 { a: Literal, x: ExprInst }
atomic_redirect!(Equals0, x);
atomic_impl!(Equals0, |Self{ a, x }: &Self| {
atomic_impl!(Equals0, |Self{ a, x }: &Self, _| {
let eqls = with_lit(x, |l| Ok(match (a, l) {
(Literal::Char(c1), Literal::Char(c2)) => c1 == c2,
(Literal::Num(n1), Literal::Num(n2)) => n1 == n2,
(Literal::Str(s1), Literal::Str(s2)) => s1 == s2,
(Literal::Uint(i1), Literal::Uint(i2)) => i1 == i2,
(Literal::Num(n1), Literal::Uint(u1)) => *n1 == (*u1 as f64),
(Literal::Uint(u1), Literal::Num(n1)) => *n1 == (*u1 as f64),
(_, _) => AssertionError::fail(x.clone(), "the expected type")?,
}))?;
Ok(Boolean::from(eqls).to_atom_cls())