mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
support for more trailing !
This commit is contained in:
parent
32c4083364
commit
aa5dc09900
1 changed files with 12 additions and 5 deletions
|
@ -857,15 +857,21 @@ fn is_matching_empty_record<'a>(
|
||||||
is_empty_record && is_pattern_empty_record
|
is_empty_record && is_pattern_empty_record
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_matching_intermediate_answer<'a>(
|
pub fn is_matching_intermediate_answer<'a>(
|
||||||
loc_pat: &'a Loc<Pattern<'a>>,
|
loc_pat: &'a Loc<Pattern<'a>>,
|
||||||
loc_expr: &'a Loc<Expr<'a>>,
|
loc_new: &'a Loc<Expr<'a>>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let pat_ident = match loc_pat.value {
|
let pat_ident = match loc_pat.value {
|
||||||
Pattern::Identifier { ident, .. } => Some(ident),
|
Pattern::Identifier { ident, .. } => Some(ident),
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
let exp_ident = match extract_wrapped_task_ok_value(loc_expr) {
|
let exp_iten = match loc_new.value {
|
||||||
|
Expr::Var {
|
||||||
|
module_name, ident, ..
|
||||||
|
} if module_name.is_empty() && ident.starts_with('#') => Some(ident),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
let exp_ident_in_task = match extract_wrapped_task_ok_value(loc_new) {
|
||||||
Some(task_expr) => match task_expr.value {
|
Some(task_expr) => match task_expr.value {
|
||||||
Expr::Var {
|
Expr::Var {
|
||||||
module_name, ident, ..
|
module_name, ident, ..
|
||||||
|
@ -874,8 +880,9 @@ fn is_matching_intermediate_answer<'a>(
|
||||||
},
|
},
|
||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
match (pat_ident, exp_ident) {
|
match (pat_ident, exp_iten, exp_ident_in_task) {
|
||||||
(Some(a), Some(b)) => a == b,
|
(Some(a), Some(b), None) => a == b,
|
||||||
|
(Some(a), None, Some(b)) => a == b,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue