mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
make backpassing an expr
This commit is contained in:
parent
5d9e4d8e3b
commit
e2d08b8f78
10 changed files with 63 additions and 112 deletions
|
@ -87,6 +87,14 @@ impl<'a> Formattable<'a> for Expr<'a> {
|
|||
.iter()
|
||||
.any(|loc_pattern| loc_pattern.is_multiline())
|
||||
}
|
||||
Backpassing(loc_patterns, loc_body, loc_ret) => {
|
||||
// check the body first because it's more likely to be multiline
|
||||
loc_body.is_multiline()
|
||||
|| loc_ret.is_multiline()
|
||||
|| loc_patterns
|
||||
.iter()
|
||||
.any(|loc_pattern| loc_pattern.is_multiline())
|
||||
}
|
||||
|
||||
Record { fields, .. } => fields.iter().any(|loc_field| loc_field.is_multiline()),
|
||||
}
|
||||
|
@ -241,6 +249,9 @@ impl<'a> Formattable<'a> for Expr<'a> {
|
|||
Closure(loc_patterns, loc_ret) => {
|
||||
fmt_closure(buf, loc_patterns, loc_ret, indent);
|
||||
}
|
||||
Backpassing(_loc_patterns, _loc_body, _loc_ret) => {
|
||||
todo!();
|
||||
}
|
||||
Defs(defs, ret) => {
|
||||
// It should theoretically be impossible to *parse* an empty defs list.
|
||||
// (Canonicalization can remove defs later, but that hasn't happened yet!)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue