remove suffixed from Pattern

This commit is contained in:
Luke Boswell 2024-04-27 13:20:51 +10:00
parent 2fe03e6c91
commit db4607125b
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
14 changed files with 69 additions and 231 deletions

View file

@ -34,7 +34,6 @@ fn next_suffixed_answer_pattern(arena: &Bump) -> (Expr, Pattern) {
},
Pattern::Identifier {
ident: answer_ident.as_str(),
suffixed: 0,
},
)
})
@ -194,18 +193,6 @@ pub fn unwrap_suffixed_expression_closure_help<'a>(
) -> Result<&'a Loc<Expr<'a>>, EUnwrapped<'a>> {
match loc_expr.value {
Expr::Closure(closure_args, closure_loc_ret) => {
// Check to make sure that arguments are not suffixed
let suffixed_arg_count = closure_args
.iter()
.filter(|loc_pat| loc_pat.value.is_suffixed())
.count();
if suffixed_arg_count > 0 {
debug_assert!(false,"closure arguments should not be suffixed");
return Err(EUnwrapped::Malformed);
}
// note we use `None` here as we don't want to pass a DefExpr up and
// unwrap the definition pattern for the closure
match unwrap_suffixed_expression(arena, closure_loc_ret, None) {