missed a Air Op Code and updated how we pass in otherwise for assignment

This commit is contained in:
microproofs
2024-06-12 01:29:14 -04:00
committed by Lucas
parent 7da35d5d73
commit df939e20ce
3 changed files with 19 additions and 48 deletions

View File

@@ -233,14 +233,6 @@ impl CodeGenSpecialFuncs {
}
}
pub fn use_function_string(&mut self, func_name: String) -> String {
if !self.used_funcs.contains(&func_name) {
self.used_funcs.push(func_name.to_string());
}
func_name
}
pub fn use_function_tree(&mut self, func_name: String) -> AirTree {
if !self.used_funcs.contains(&func_name) {
self.used_funcs.push(func_name.to_string());

View File

@@ -215,8 +215,8 @@ pub enum AirTree {
// Misc.
FieldsEmpty {
constr: Box<AirTree>,
msg: Option<AirMsg>,
then: Box<AirTree>,
otherwise: Box<AirTree>,
},
ListEmpty {
list: Box<AirTree>,
@@ -960,11 +960,11 @@ impl AirTree {
AirTree::NoOp { then: then.into() }
}
pub fn fields_empty(constr: AirTree, msg: Option<AirMsg>, then: AirTree) -> AirTree {
pub fn fields_empty(constr: AirTree, then: AirTree, otherwise: AirTree) -> AirTree {
AirTree::FieldsEmpty {
constr: constr.into(),
msg,
then: then.into(),
otherwise: otherwise.into(),
}
}
@@ -1284,15 +1284,16 @@ impl AirTree {
otherwise.create_air_vec(air_vec);
}
}
AirTree::FieldsEmpty { constr, msg, then } => {
AirTree::FieldsEmpty {
constr,
then,
otherwise,
} => {
air_vec.push(Air::FieldsEmpty);
if let Some(msg) = msg {
msg.to_air_tree().create_air_vec(air_vec);
}
constr.create_air_vec(air_vec);
then.create_air_vec(air_vec);
otherwise.create_air_vec(air_vec);
}
AirTree::ListEmpty {
list,