fix todo and list and tuple not equal comparator
This commit is contained in:
parent
7867793bcd
commit
b1dec1259d
|
@ -2675,63 +2675,63 @@ impl<'a> CodeGenerator<'a> {
|
|||
} else if tipo.is_tuple()
|
||||
&& matches!(tipo.clone().get_uplc_type(), UplcType::Pair(_, _))
|
||||
{
|
||||
// let term = Term::Apply {
|
||||
// function: Term::Apply {
|
||||
// function: default_builtin.into(),
|
||||
// argument: Term::Apply {
|
||||
// function: DefaultFunction::MapData.into(),
|
||||
// argument: Term::Apply {
|
||||
// function: Term::Apply {
|
||||
// function: Term::Builtin(DefaultFunction::MkCons)
|
||||
// .force_wrap()
|
||||
// .into(),
|
||||
// argument: left.into(),
|
||||
// }
|
||||
// .into(),
|
||||
// argument: Term::Constant(UplcConstant::ProtoList(
|
||||
// UplcType::Pair(
|
||||
// UplcType::Data.into(),
|
||||
// UplcType::Data.into(),
|
||||
// ),
|
||||
// vec![],
|
||||
// ))
|
||||
// .into(),
|
||||
// }
|
||||
// .into(),
|
||||
// }
|
||||
// .into(),
|
||||
// }
|
||||
// .into(),
|
||||
// argument: Term::Apply {
|
||||
// function: Term::Apply {
|
||||
// function: Term::Builtin(DefaultFunction::MkCons)
|
||||
// .force_wrap()
|
||||
// .into(),
|
||||
// argument: right.into(),
|
||||
// }
|
||||
// .into(),
|
||||
// argument: Term::Constant(UplcConstant::ProtoList(
|
||||
// UplcType::Pair(
|
||||
// UplcType::Data.into(),
|
||||
// UplcType::Data.into(),
|
||||
// ),
|
||||
// vec![],
|
||||
// ))
|
||||
// .into(),
|
||||
// }
|
||||
// .into(),
|
||||
// };
|
||||
// arg_stack.push(term);
|
||||
// return;
|
||||
todo!()
|
||||
} else if tipo.is_list() {
|
||||
let term = Term::Apply {
|
||||
let mut term = Term::Apply {
|
||||
function: Term::Apply {
|
||||
function: default_builtin.into(),
|
||||
argument: Term::Apply {
|
||||
function: DefaultFunction::MapData.into(),
|
||||
argument: Term::Apply {
|
||||
function: Term::Apply {
|
||||
function: Term::Builtin(DefaultFunction::IfThenElse)
|
||||
function: Term::Builtin(DefaultFunction::MkCons)
|
||||
.force_wrap()
|
||||
.into(),
|
||||
argument: left.into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Constant(UplcConstant::ProtoList(
|
||||
UplcType::Pair(
|
||||
UplcType::Data.into(),
|
||||
UplcType::Data.into(),
|
||||
),
|
||||
vec![],
|
||||
))
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Apply {
|
||||
function: Term::Apply {
|
||||
function: Term::Builtin(DefaultFunction::MkCons)
|
||||
.force_wrap()
|
||||
.into(),
|
||||
argument: right.into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Constant(UplcConstant::ProtoList(
|
||||
UplcType::Pair(
|
||||
UplcType::Data.into(),
|
||||
UplcType::Data.into(),
|
||||
),
|
||||
vec![],
|
||||
))
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
};
|
||||
|
||||
term = if_else(
|
||||
term,
|
||||
Term::Constant(UplcConstant::Bool(false)),
|
||||
Term::Constant(UplcConstant::Bool(true)),
|
||||
);
|
||||
arg_stack.push(term);
|
||||
return;
|
||||
} else if tipo.is_list() {
|
||||
let term = if_else(
|
||||
Term::Apply {
|
||||
function: Term::Apply {
|
||||
function: default_builtin.into(),
|
||||
argument: Term::Apply {
|
||||
|
@ -2750,15 +2750,10 @@ impl<'a> CodeGenerator<'a> {
|
|||
.into(),
|
||||
}
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Constant(UplcConstant::Bool(false)).into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Constant(UplcConstant::Bool(true)).into(),
|
||||
};
|
||||
},
|
||||
Term::Constant(UplcConstant::Bool(false)),
|
||||
Term::Constant(UplcConstant::Bool(true)),
|
||||
);
|
||||
|
||||
arg_stack.push(term);
|
||||
return;
|
||||
|
@ -3542,8 +3537,9 @@ impl<'a> CodeGenerator<'a> {
|
|||
.into(),
|
||||
}
|
||||
.into(),
|
||||
argument: Term::Error.into(),
|
||||
};
|
||||
argument: Term::Delay(Term::Error.into()).into(),
|
||||
}
|
||||
.force_wrap();
|
||||
|
||||
arg_stack.push(term);
|
||||
}
|
||||
|
@ -3713,7 +3709,7 @@ impl<'a> CodeGenerator<'a> {
|
|||
function: Term::Apply {
|
||||
function: Term::Builtin(DefaultFunction::Trace).force_wrap().into(),
|
||||
argument: Term::Constant(UplcConstant::String(
|
||||
text.unwrap_or_else(|| "aike::trace".to_string()),
|
||||
text.unwrap_or_else(|| "aiken::trace".to_string()),
|
||||
))
|
||||
.into(),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue