mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
check if final expr in deps is suffixed
This commit is contained in:
parent
1b10772bcb
commit
bff73ff6b2
2 changed files with 24 additions and 5 deletions
|
@ -575,8 +575,7 @@ pub fn is_expr_suffixed(expr: &Expr) -> bool {
|
|||
Expr::Closure(_, sub_loc_expr) => is_expr_suffixed(&sub_loc_expr.value),
|
||||
|
||||
// expressions inside a Defs
|
||||
// note we ignore the final expression as it should not be suffixed
|
||||
Expr::Defs(defs, _) => {
|
||||
Expr::Defs(defs, expr) => {
|
||||
let any_defs_suffixed = defs.tags.iter().any(|tag| match tag.split() {
|
||||
Ok(_) => false,
|
||||
Err(value_index) => match defs.value_defs[value_index.index()] {
|
||||
|
@ -586,7 +585,7 @@ pub fn is_expr_suffixed(expr: &Expr) -> bool {
|
|||
},
|
||||
});
|
||||
|
||||
any_defs_suffixed
|
||||
any_defs_suffixed || is_expr_suffixed(&expr.value)
|
||||
}
|
||||
Expr::Float(_) => false,
|
||||
Expr::Num(_) => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue