In most cases the context isn't need so I made the code more explicit about that
This commit is contained in:
parent
575dde9885
commit
4ab3b61200
|
@ -242,17 +242,21 @@ impl<'a> CodeGenerator<'a> {
|
||||||
module_build_name: &String,
|
module_build_name: &String,
|
||||||
context: &[TypedExpr],
|
context: &[TypedExpr],
|
||||||
) -> AirTree {
|
) -> AirTree {
|
||||||
match body {
|
if !context.is_empty() {
|
||||||
TypedExpr::Assignment {
|
let TypedExpr::Assignment {
|
||||||
location,
|
location,
|
||||||
tipo,
|
tipo,
|
||||||
value,
|
value,
|
||||||
pattern,
|
pattern,
|
||||||
kind,
|
kind,
|
||||||
} if !context.is_empty() => {
|
} = body
|
||||||
|
else {
|
||||||
|
panic!("Dangling expressions without an assignment")
|
||||||
|
};
|
||||||
|
|
||||||
let replaced_type = convert_opaque_type(tipo, &self.data_types);
|
let replaced_type = convert_opaque_type(tipo, &self.data_types);
|
||||||
|
|
||||||
let air_value = self.build(value, module_build_name, context);
|
let air_value = self.build(value, module_build_name, &[]);
|
||||||
|
|
||||||
let msg_func = match self.tracing {
|
let msg_func = match self.tracing {
|
||||||
TraceLevel::Silent => None,
|
TraceLevel::Silent => None,
|
||||||
|
@ -266,11 +270,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
&self.module_src,
|
&self.module_src,
|
||||||
)
|
)
|
||||||
.to_string(),
|
.to_string(),
|
||||||
TraceLevel::Verbose => get_src_code_by_span(
|
TraceLevel::Verbose => {
|
||||||
module_build_name,
|
get_src_code_by_span(module_build_name, location, &self.module_src)
|
||||||
location,
|
}
|
||||||
&self.module_src,
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let msg_func_name = msg.split_whitespace().join("");
|
let msg_func_name = msg.split_whitespace().join("");
|
||||||
|
@ -288,9 +290,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let (then, context) = context
|
let (then, context) = context.split_first().unwrap();
|
||||||
.split_first()
|
|
||||||
.expect("found an assignment without a next expression?");
|
|
||||||
|
|
||||||
let then = self.build(then, module_build_name, context);
|
let then = self.build(then, module_build_name, context);
|
||||||
|
|
||||||
|
@ -307,11 +307,16 @@ impl<'a> CodeGenerator<'a> {
|
||||||
msg_func,
|
msg_func,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
match body {
|
||||||
|
TypedExpr::Assignment { .. } => {
|
||||||
|
panic!("Reached assignment with no dangling expressions")
|
||||||
}
|
}
|
||||||
TypedExpr::UInt { value, .. } => AirTree::int(value),
|
TypedExpr::UInt { value, .. } => AirTree::int(value),
|
||||||
TypedExpr::String { value, .. } => AirTree::string(value),
|
TypedExpr::String { value, .. } => AirTree::string(value),
|
||||||
TypedExpr::ByteArray { bytes, .. } => AirTree::byte_array(bytes.clone()),
|
TypedExpr::ByteArray { bytes, .. } => AirTree::byte_array(bytes.clone()),
|
||||||
TypedExpr::Sequence { expressions, .. } | TypedExpr::Pipeline { expressions, .. } => {
|
TypedExpr::Sequence { expressions, .. }
|
||||||
|
| TypedExpr::Pipeline { expressions, .. } => {
|
||||||
let (expr, dangling_expressions) = expressions
|
let (expr, dangling_expressions) = expressions
|
||||||
.split_first()
|
.split_first()
|
||||||
.expect("Sequence or Pipeline should have at least one expression");
|
.expect("Sequence or Pipeline should have at least one expression");
|
||||||
|
@ -321,7 +326,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
TypedExpr::Var {
|
TypedExpr::Var {
|
||||||
constructor, name, ..
|
constructor, name, ..
|
||||||
} => match &constructor.variant {
|
} => match &constructor.variant {
|
||||||
ValueConstructorVariant::ModuleConstant { literal, .. } => constants_ir(literal),
|
ValueConstructorVariant::ModuleConstant { literal, .. } => {
|
||||||
|
constants_ir(literal)
|
||||||
|
}
|
||||||
_ => AirTree::var(constructor.clone(), name, ""),
|
_ => AirTree::var(constructor.clone(), name, ""),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -329,7 +336,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
args.iter()
|
args.iter()
|
||||||
.map(|arg| arg.arg_name.get_variable_name().unwrap_or("_").to_string())
|
.map(|arg| arg.arg_name.get_variable_name().unwrap_or("_").to_string())
|
||||||
.collect_vec(),
|
.collect_vec(),
|
||||||
self.build(body, module_build_name, context),
|
self.build(body, module_build_name, &[]),
|
||||||
),
|
),
|
||||||
|
|
||||||
TypedExpr::List {
|
TypedExpr::List {
|
||||||
|
@ -340,11 +347,11 @@ impl<'a> CodeGenerator<'a> {
|
||||||
} => AirTree::list(
|
} => AirTree::list(
|
||||||
elements
|
elements
|
||||||
.iter()
|
.iter()
|
||||||
.map(|elem| self.build(elem, module_build_name, context))
|
.map(|elem| self.build(elem, module_build_name, &[]))
|
||||||
.collect_vec(),
|
.collect_vec(),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
tail.as_ref()
|
tail.as_ref()
|
||||||
.map(|tail| self.build(tail, module_build_name, context)),
|
.map(|tail| self.build(tail, module_build_name, &[])),
|
||||||
),
|
),
|
||||||
|
|
||||||
TypedExpr::Call {
|
TypedExpr::Call {
|
||||||
|
@ -387,11 +394,11 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.map(|(arg, tipo)| {
|
.map(|(arg, tipo)| {
|
||||||
if tipo.is_data() {
|
if tipo.is_data() {
|
||||||
AirTree::cast_to_data(
|
AirTree::cast_to_data(
|
||||||
self.build(&arg.value, module_build_name, context),
|
self.build(&arg.value, module_build_name, &[]),
|
||||||
arg.value.tipo(),
|
arg.value.tipo(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
self.build(&arg.value, module_build_name, context)
|
self.build(&arg.value, module_build_name, &[])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
|
@ -418,7 +425,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.zip(fun_arg_types)
|
.zip(fun_arg_types)
|
||||||
.map(|(arg, arg_tipo)| {
|
.map(|(arg, arg_tipo)| {
|
||||||
let mut arg_val = self.build(&arg.value, module_build_name, context);
|
let mut arg_val = self.build(&arg.value, module_build_name, &[]);
|
||||||
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
||||||
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
||||||
}
|
}
|
||||||
|
@ -430,7 +437,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
AirTree::builtin(*func, tipo.clone(), func_args)
|
AirTree::builtin(*func, tipo.clone(), func_args)
|
||||||
} else {
|
} else {
|
||||||
AirTree::call(
|
AirTree::call(
|
||||||
self.build(fun.as_ref(), module_build_name, context),
|
self.build(fun.as_ref(), module_build_name, &[]),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
func_args,
|
func_args,
|
||||||
)
|
)
|
||||||
|
@ -445,7 +452,8 @@ impl<'a> CodeGenerator<'a> {
|
||||||
let type_info = self.module_types.get(module_name).unwrap();
|
let type_info = self.module_types.get(module_name).unwrap();
|
||||||
let value = type_info.values.get(name).unwrap();
|
let value = type_info.values.get(name).unwrap();
|
||||||
|
|
||||||
let ValueConstructorVariant::ModuleFn { builtin, .. } = &value.variant else {
|
let ValueConstructorVariant::ModuleFn { builtin, .. } = &value.variant
|
||||||
|
else {
|
||||||
unreachable!("Missing module function definition")
|
unreachable!("Missing module function definition")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -460,7 +468,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.zip(fun_arg_types)
|
.zip(fun_arg_types)
|
||||||
.map(|(arg, arg_tipo)| {
|
.map(|(arg, arg_tipo)| {
|
||||||
let mut arg_val = self.build(&arg.value, module_build_name, context);
|
let mut arg_val = self.build(&arg.value, module_build_name, &[]);
|
||||||
|
|
||||||
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
||||||
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
||||||
|
@ -473,7 +481,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
AirTree::builtin(*func, tipo.clone(), func_args)
|
AirTree::builtin(*func, tipo.clone(), func_args)
|
||||||
} else {
|
} else {
|
||||||
AirTree::call(
|
AirTree::call(
|
||||||
self.build(fun.as_ref(), module_build_name, context),
|
self.build(fun.as_ref(), module_build_name, &[]),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
func_args,
|
func_args,
|
||||||
)
|
)
|
||||||
|
@ -491,7 +499,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.zip(fun_arg_types)
|
.zip(fun_arg_types)
|
||||||
.map(|(arg, arg_tipo)| {
|
.map(|(arg, arg_tipo)| {
|
||||||
let mut arg_val = self.build(&arg.value, module_build_name, context);
|
let mut arg_val = self.build(&arg.value, module_build_name, &[]);
|
||||||
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
if arg_tipo.is_data() && !arg.value.tipo().is_data() {
|
||||||
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
arg_val = AirTree::cast_to_data(arg_val, arg.value.tipo())
|
||||||
}
|
}
|
||||||
|
@ -500,7 +508,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
|
|
||||||
AirTree::call(
|
AirTree::call(
|
||||||
self.build(fun.as_ref(), module_build_name, context),
|
self.build(fun.as_ref(), module_build_name, &[]),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
func_args,
|
func_args,
|
||||||
)
|
)
|
||||||
|
@ -515,21 +523,17 @@ impl<'a> CodeGenerator<'a> {
|
||||||
} => AirTree::binop(
|
} => AirTree::binop(
|
||||||
*name,
|
*name,
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(left, module_build_name, context),
|
self.build(left, module_build_name, &[]),
|
||||||
self.build(right, module_build_name, context),
|
self.build(right, module_build_name, &[]),
|
||||||
left.tipo(),
|
left.tipo(),
|
||||||
),
|
),
|
||||||
|
|
||||||
TypedExpr::Assignment { .. } => {
|
|
||||||
panic!("Reached assignment with no dangling expressions")
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedExpr::Trace {
|
TypedExpr::Trace {
|
||||||
tipo, then, text, ..
|
tipo, then, text, ..
|
||||||
} => AirTree::trace(
|
} => AirTree::trace(
|
||||||
self.build(text, module_build_name, context),
|
self.build(text, module_build_name, &[]),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(then, module_build_name, context),
|
self.build(then, module_build_name, &[]),
|
||||||
),
|
),
|
||||||
|
|
||||||
TypedExpr::When {
|
TypedExpr::When {
|
||||||
|
@ -548,11 +552,11 @@ impl<'a> CodeGenerator<'a> {
|
||||||
} else if clauses.len() == 1 {
|
} else if clauses.len() == 1 {
|
||||||
let last_clause = clauses.pop().unwrap();
|
let last_clause = clauses.pop().unwrap();
|
||||||
|
|
||||||
let clause_then = self.build(&last_clause.then, module_build_name, context);
|
let clause_then = self.build(&last_clause.then, module_build_name, &[]);
|
||||||
|
|
||||||
let subject_type = subject.tipo();
|
let subject_type = subject.tipo();
|
||||||
|
|
||||||
let subject_val = self.build(subject, module_build_name, context);
|
let subject_val = self.build(subject, module_build_name, &[]);
|
||||||
|
|
||||||
self.assignment(
|
self.assignment(
|
||||||
&last_clause.pattern,
|
&last_clause.pattern,
|
||||||
|
@ -598,7 +602,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_name.clone(),
|
subject_name.clone(),
|
||||||
),
|
),
|
||||||
module_build_name,
|
module_build_name,
|
||||||
context,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let when_assign = AirTree::when(
|
let when_assign = AirTree::when(
|
||||||
|
@ -611,7 +614,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
AirTree::let_assignment(
|
AirTree::let_assignment(
|
||||||
constr_var,
|
constr_var,
|
||||||
self.build(subject, module_build_name, context),
|
self.build(subject, module_build_name, &[]),
|
||||||
when_assign,
|
when_assign,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -627,13 +630,13 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|branch| {
|
.map(|branch| {
|
||||||
(
|
(
|
||||||
self.build(&branch.condition, module_build_name, context),
|
self.build(&branch.condition, module_build_name, &[]),
|
||||||
self.build(&branch.body, module_build_name, context),
|
self.build(&branch.body, module_build_name, &[]),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect_vec(),
|
.collect_vec(),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(final_else, module_build_name, context),
|
self.build(final_else, module_build_name, &[]),
|
||||||
),
|
),
|
||||||
|
|
||||||
TypedExpr::RecordAccess {
|
TypedExpr::RecordAccess {
|
||||||
|
@ -643,7 +646,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
|
if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
|
||||||
self.build(record, module_build_name, context)
|
self.build(record, module_build_name, &[])
|
||||||
} else {
|
} else {
|
||||||
let function_name = format!("__access_index_{}", *index);
|
let function_name = format!("__access_index_{}", *index);
|
||||||
|
|
||||||
|
@ -673,7 +676,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
self.special_functions
|
self.special_functions
|
||||||
.use_function_tree(CONSTR_FIELDS_EXPOSER.to_string()),
|
.use_function_tree(CONSTR_FIELDS_EXPOSER.to_string()),
|
||||||
list(data()),
|
list(data()),
|
||||||
vec![self.build(record, module_build_name, context)],
|
vec![self.build(record, module_build_name, &[])],
|
||||||
);
|
);
|
||||||
|
|
||||||
AirTree::index_access(function_name, tipo.clone(), list_of_fields)
|
AirTree::index_access(function_name, tipo.clone(), list_of_fields)
|
||||||
|
@ -706,7 +709,8 @@ impl<'a> CodeGenerator<'a> {
|
||||||
constructors_count: data_type
|
constructors_count: data_type
|
||||||
.expect("Created a module type without a definition?")
|
.expect("Created a module type without a definition?")
|
||||||
.constructors
|
.constructors
|
||||||
.len() as u16,
|
.len()
|
||||||
|
as u16,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -740,13 +744,15 @@ impl<'a> CodeGenerator<'a> {
|
||||||
AirTree::builtin(*builtin, tipo.clone(), vec![])
|
AirTree::builtin(*builtin, tipo.clone(), vec![])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ModuleValueConstructor::Constant { literal, .. } => builder::constants_ir(literal),
|
ModuleValueConstructor::Constant { literal, .. } => {
|
||||||
|
builder::constants_ir(literal)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
TypedExpr::Tuple { tipo, elems, .. } => AirTree::tuple(
|
TypedExpr::Tuple { tipo, elems, .. } => AirTree::tuple(
|
||||||
elems
|
elems
|
||||||
.iter()
|
.iter()
|
||||||
.map(|elem| self.build(elem, module_build_name, context))
|
.map(|elem| self.build(elem, module_build_name, &[]))
|
||||||
.collect_vec(),
|
.collect_vec(),
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
),
|
),
|
||||||
|
@ -758,7 +764,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
AirTree::pair_index(
|
AirTree::pair_index(
|
||||||
*index,
|
*index,
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(tuple, module_build_name, context),
|
self.build(tuple, module_build_name, &[]),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
let function_name = format!("__access_index_{}", *index);
|
let function_name = format!("__access_index_{}", *index);
|
||||||
|
@ -788,7 +794,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
AirTree::index_access(
|
AirTree::index_access(
|
||||||
function_name,
|
function_name,
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(tuple, module_build_name, context),
|
self.build(tuple, module_build_name, &[]),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -807,7 +813,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
.iter()
|
.iter()
|
||||||
.sorted_by(|arg1, arg2| arg1.index.cmp(&arg2.index))
|
.sorted_by(|arg1, arg2| arg1.index.cmp(&arg2.index))
|
||||||
{
|
{
|
||||||
let arg_val = self.build(&arg.value, module_build_name, context);
|
let arg_val = self.build(&arg.value, module_build_name, &[]);
|
||||||
|
|
||||||
if arg.index > highest_index {
|
if arg.index > highest_index {
|
||||||
highest_index = arg.index;
|
highest_index = arg.index;
|
||||||
|
@ -821,16 +827,17 @@ impl<'a> CodeGenerator<'a> {
|
||||||
index_types,
|
index_types,
|
||||||
highest_index,
|
highest_index,
|
||||||
tipo.clone(),
|
tipo.clone(),
|
||||||
self.build(spread, module_build_name, context),
|
self.build(spread, module_build_name, &[]),
|
||||||
update_args,
|
update_args,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
TypedExpr::UnOp { value, op, .. } => {
|
TypedExpr::UnOp { value, op, .. } => {
|
||||||
AirTree::unop(*op, self.build(value, module_build_name, context))
|
AirTree::unop(*op, self.build(value, module_build_name, &[]))
|
||||||
}
|
}
|
||||||
TypedExpr::CurvePoint { point, .. } => AirTree::curve(*point.as_ref()),
|
TypedExpr::CurvePoint { point, .. } => AirTree::curve(*point.as_ref()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn assignment(
|
pub fn assignment(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1780,7 +1787,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo: &Rc<Type>,
|
subject_tipo: &Rc<Type>,
|
||||||
props: &mut ClauseProperties,
|
props: &mut ClauseProperties,
|
||||||
module_name: &String,
|
module_name: &String,
|
||||||
context: &[TypedExpr],
|
|
||||||
) -> AirTree {
|
) -> AirTree {
|
||||||
assert!(
|
assert!(
|
||||||
!subject_tipo.is_void(),
|
!subject_tipo.is_void(),
|
||||||
|
@ -1789,7 +1795,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
props.complex_clause = false;
|
props.complex_clause = false;
|
||||||
|
|
||||||
if let Some((clause, rest_clauses)) = clauses.split_first() {
|
if let Some((clause, rest_clauses)) = clauses.split_first() {
|
||||||
let mut clause_then = self.build(&clause.then, module_name, context);
|
let mut clause_then = self.build(&clause.then, module_name, &[]);
|
||||||
|
|
||||||
// handles clause guard if it exists
|
// handles clause guard if it exists
|
||||||
if let Some(guard) = &clause.guard {
|
if let Some(guard) = &clause.guard {
|
||||||
|
@ -1835,7 +1841,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
} else if let Some(data_type) = data_type {
|
} else if let Some(data_type) = data_type {
|
||||||
|
@ -1851,7 +1856,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
complex_clause,
|
complex_clause,
|
||||||
)
|
)
|
||||||
|
@ -1864,7 +1868,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1883,7 +1886,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
complex_clause,
|
complex_clause,
|
||||||
)
|
)
|
||||||
|
@ -1930,7 +1932,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -2032,7 +2033,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
next_tail_name,
|
next_tail_name,
|
||||||
complex_clause,
|
complex_clause,
|
||||||
|
@ -2046,7 +2046,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2095,7 +2094,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -2111,7 +2109,6 @@ impl<'a> CodeGenerator<'a> {
|
||||||
subject_tipo,
|
subject_tipo,
|
||||||
&mut next_clause_props,
|
&mut next_clause_props,
|
||||||
module_name,
|
module_name,
|
||||||
context,
|
|
||||||
),
|
),
|
||||||
props.complex_clause,
|
props.complex_clause,
|
||||||
)
|
)
|
||||||
|
@ -2124,7 +2121,7 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
assert!(final_clause.guard.is_none());
|
assert!(final_clause.guard.is_none());
|
||||||
|
|
||||||
let clause_then = self.build(&final_clause.then, module_name, context);
|
let clause_then = self.build(&final_clause.then, module_name, &[]);
|
||||||
|
|
||||||
let (condition, assignments) =
|
let (condition, assignments) =
|
||||||
self.clause_pattern(&final_clause.pattern, subject_tipo, props, clause_then);
|
self.clause_pattern(&final_clause.pattern, subject_tipo, props, clause_then);
|
||||||
|
|
Loading…
Reference in New Issue