This commit is contained in:
Folkert 2021-10-17 16:08:41 +02:00
parent cdec69d8a8
commit 9763f9b51b
7 changed files with 912 additions and 1 deletions

View file

@ -1050,6 +1050,13 @@ impl<'a> Call<'a> {
.text(format!("lowlevel {:?} ", lowlevel))
.append(alloc.intersperse(it, " "))
}
NewHigherOrderLowLevel { op: lowlevel, .. } => {
let it = arguments.iter().map(|s| symbol_to_doc(alloc, *s));
alloc
.text(format!("lowlevel {:?} ", lowlevel))
.append(alloc.intersperse(it, " "))
}
Foreign {
ref foreign_symbol, ..
} => {
@ -1113,6 +1120,27 @@ pub enum CallType<'a> {
arg_layouts: &'a [Layout<'a>],
ret_layout: Layout<'a>,
},
NewHigherOrderLowLevel {
op: crate::low_level::HigherOrder,
/// the layout of the closure argument, if any
closure_env_layout: Option<Layout<'a>>,
/// name of the top-level function that is passed as an argument
/// e.g. in `List.map xs Num.abs` this would be `Num.abs`
function_name: Symbol,
/// Symbol of the environment captured by the function argument
function_env: Symbol,
/// does the function argument need to own the closure data
function_owns_closure_data: bool,
/// specialization id of the function argument, used for name generation
specialization_id: CallSpecId,
/// function layout, used for name generation
arg_layouts: &'a [Layout<'a>],
ret_layout: Layout<'a>,
},
}
#[derive(Clone, Debug, PartialEq)]
@ -5447,6 +5475,7 @@ fn substitute_in_call<'a>(
CallType::Foreign { .. } => None,
CallType::LowLevel { .. } => None,
CallType::HigherOrderLowLevel { .. } => None,
CallType::NewHigherOrderLowLevel { .. } => None,
};
let mut did_change = false;