fix: switch from unwrap to if let to allow boolean when
fix: test 67 fixed to take in ByteArray instead of string literal
This commit is contained in:
@@ -756,16 +756,29 @@ impl<'a> CodeGenerator<'a> {
|
||||
scope.clone(),
|
||||
);
|
||||
|
||||
let data_type =
|
||||
lookup_data_type_by_tipo(self.data_types.clone(), subject_type).unwrap();
|
||||
let data_type = lookup_data_type_by_tipo(self.data_types.clone(), subject_type);
|
||||
|
||||
if data_type.constructors.len() > 1 {
|
||||
ir_stack.push(Air::Clause {
|
||||
scope,
|
||||
tipo: subject_type.clone(),
|
||||
complex_clause: *clause_properties.is_complex_clause(),
|
||||
subject_name,
|
||||
});
|
||||
if let Some(data_type) = data_type {
|
||||
if data_type.constructors.len() > 1 {
|
||||
ir_stack.push(Air::Clause {
|
||||
scope,
|
||||
tipo: subject_type.clone(),
|
||||
complex_clause: *clause_properties.is_complex_clause(),
|
||||
subject_name,
|
||||
});
|
||||
} else {
|
||||
ir_stack.push(Air::Clause {
|
||||
scope: scope.clone(),
|
||||
tipo: subject_type.clone(),
|
||||
complex_clause: *clause_properties.is_complex_clause(),
|
||||
subject_name,
|
||||
});
|
||||
|
||||
ir_stack.push(Air::Int {
|
||||
scope,
|
||||
value: "0".to_string(),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
ir_stack.push(Air::Clause {
|
||||
scope: scope.clone(),
|
||||
@@ -773,11 +786,6 @@ impl<'a> CodeGenerator<'a> {
|
||||
complex_clause: *clause_properties.is_complex_clause(),
|
||||
subject_name,
|
||||
});
|
||||
|
||||
ir_stack.push(Air::Int {
|
||||
scope,
|
||||
value: "0".to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
ClauseProperties::ListClause {
|
||||
|
||||
Reference in New Issue
Block a user