mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Several fixes found in fuzzing
This commit is contained in:
parent
e9caada3f1
commit
b9862b47dc
49 changed files with 1060 additions and 523 deletions
|
@ -43,6 +43,7 @@ pub enum Parens {
|
|||
InApply,
|
||||
InOperator,
|
||||
InAsPattern,
|
||||
InApplyLastArg,
|
||||
}
|
||||
|
||||
/// In an AST node, do we show newlines around it
|
||||
|
@ -238,6 +239,7 @@ fn fmt_ty_ann(
|
|||
let is_first = index == 0;
|
||||
|
||||
if !is_first {
|
||||
buf.indent(indent);
|
||||
buf.push_str(",");
|
||||
if !self_is_multiline {
|
||||
buf.spaces(1);
|
||||
|
|
|
@ -1009,7 +1009,7 @@ pub fn fmt_body<'a>(
|
|||
return body.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
|
||||
}
|
||||
|
||||
pattern.format_with_options(buf, Parens::InApply, Newlines::No, indent);
|
||||
pattern.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
|
||||
buf.indent(indent);
|
||||
buf.push_str(" =");
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -204,7 +204,6 @@ fn fmt_pattern_inner(
|
|||
|
||||
if it.peek().is_some() {
|
||||
buf.push_str(",");
|
||||
buf.spaces(1);
|
||||
}
|
||||
|
||||
if !item.after.is_empty() {
|
||||
|
@ -218,6 +217,9 @@ fn fmt_pattern_inner(
|
|||
fmt_spaces(buf, item.after.iter(), indent);
|
||||
}
|
||||
}
|
||||
if it.peek().is_some() {
|
||||
buf.ensure_ends_with_whitespace();
|
||||
}
|
||||
}
|
||||
buf.spaces(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue