mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Fix a bunch of bugs in parsing/formatting found by fuzzing
This commit is contained in:
parent
acd446f6bd
commit
3fee0d3e8f
43 changed files with 593 additions and 70 deletions
|
@ -76,8 +76,19 @@ impl<'a> Formattable for TypeDef<'a> {
|
|||
|
||||
for var in *vars {
|
||||
buf.spaces(1);
|
||||
|
||||
let need_parens = matches!(var.value, Pattern::Apply(..));
|
||||
|
||||
if need_parens {
|
||||
buf.push_str("(");
|
||||
}
|
||||
|
||||
fmt_pattern(buf, &var.value, indent, Parens::NotNeeded);
|
||||
buf.indent(indent);
|
||||
|
||||
if need_parens {
|
||||
buf.push_str(")");
|
||||
}
|
||||
}
|
||||
|
||||
buf.push_str(" :");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue