minor refactor
This commit is contained in:
parent
6fa272bd34
commit
af90b38bf8
|
@ -475,35 +475,29 @@ impl<'a> CodeGenerator<'a> {
|
||||||
let air_value = self.build(value, module_name);
|
let air_value = self.build(value, module_name);
|
||||||
|
|
||||||
let msg_func = match self.tracing {
|
let msg_func = match self.tracing {
|
||||||
TraceLevel::Silent => None,
|
TraceLevel::Verbose | TraceLevel::Compact if kind.is_expect() => {
|
||||||
TraceLevel::Verbose | TraceLevel::Compact => {
|
let msg = match self.tracing {
|
||||||
if kind.is_expect() {
|
TraceLevel::Silent => unreachable!("excluded from pattern guards"),
|
||||||
let msg = match self.tracing {
|
TraceLevel::Compact => {
|
||||||
TraceLevel::Silent => unreachable!("excluded from pattern guards"),
|
get_line_columns_by_span(module_name, location, &self.module_src)
|
||||||
TraceLevel::Compact => get_line_columns_by_span(
|
.to_string()
|
||||||
module_name,
|
}
|
||||||
location,
|
TraceLevel::Verbose => {
|
||||||
&self.module_src,
|
get_src_code_by_span(module_name, location, &self.module_src)
|
||||||
)
|
}
|
||||||
.to_string(),
|
};
|
||||||
TraceLevel::Verbose => {
|
|
||||||
get_src_code_by_span(module_name, location, &self.module_src)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let msg_func_name = msg.split_whitespace().join("");
|
let msg_func_name = msg.split_whitespace().join("");
|
||||||
|
|
||||||
self.special_functions.insert_new_function(
|
self.special_functions.insert_new_function(
|
||||||
msg_func_name.clone(),
|
msg_func_name.clone(),
|
||||||
Term::string(msg),
|
Term::string(msg),
|
||||||
string(),
|
string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Some(self.special_functions.use_function_msg(msg_func_name))
|
Some(self.special_functions.use_function_msg(msg_func_name))
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
self.assignment(
|
self.assignment(
|
||||||
|
|
Loading…
Reference in New Issue