make backpassing an expr

This commit is contained in:
Folkert 2021-03-06 16:05:18 +01:00
parent 5d9e4d8e3b
commit e2d08b8f78
10 changed files with 63 additions and 112 deletions

View file

@ -118,6 +118,7 @@ pub enum Expr<'a> {
Closure(&'a [Loc<Pattern<'a>>], &'a Loc<Expr<'a>>),
/// Multiple defs in a row
Defs(&'a [&'a Loc<Def<'a>>], &'a Loc<Expr<'a>>),
Backpassing(&'a [Loc<Pattern<'a>>], &'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
// Application
/// To apply by name, do Apply(Var(...), ...)
@ -187,8 +188,6 @@ pub enum Def<'a> {
body_expr: &'a Loc<Expr<'a>>,
},
Backpassing(&'a [Loc<Pattern<'a>>], &'a Loc<Expr<'a>>),
// Blank Space (e.g. comments, spaces, newlines) before or after a def.
// We preserve this for the formatter; canonicalization ignores it.
SpaceBefore(&'a Def<'a>, &'a [CommentOrNewline<'a>]),