Starting to add no arg tag union

This commit is contained in:
Eric Henry 2021-05-17 17:07:19 -04:00
parent b7b04344f3
commit d34f984169
7 changed files with 492 additions and 330 deletions

View file

@ -158,6 +158,14 @@ pub enum Expr {
arguments: Vec<(Variable, Located<Expr>)>,
},
ZeroArgumentTag {
closure_name: Symbol,
variant_var: Variable,
ext_var: Variable,
name: TagName,
arguments: Vec<(Variable, Located<Expr>)>,
},
// Test
Expect(Box<Located<Expr>>, Box<Located<Expr>>),
@ -1427,6 +1435,23 @@ pub fn inline_calls(var_store: &mut VarStore, scope: &mut Scope, expr: Expr) ->
);
}
ZeroArgumentTag {
closure_name,
variant_var,
ext_var,
name,
arguments,
} => {
todo!(
"Inlining for ZeroArgumentTag with closure_name {:?}, variant_var {:?}, ext_var {:?}, name {:?}, arguments {:?}",
closure_name,
variant_var,
ext_var,
name,
arguments
);
}
Call(boxed_tuple, args, called_via) => {
let (fn_var, loc_expr, closure_var, expr_var) = *boxed_tuple;