mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add some tests.... and fix some bugs!
This commit is contained in:
parent
2000948765
commit
6be94c5f29
3 changed files with 40 additions and 17 deletions
|
@ -814,10 +814,8 @@ pub fn fmt_record<'a>(
|
|||
format_field_multiline(buf, &field.value, field_indent, "");
|
||||
}
|
||||
|
||||
if final_comments.iter().any(|s| s.is_comment()) {
|
||||
newline(buf, field_indent);
|
||||
fmt_final_comments_spaces(buf, final_comments.iter(), field_indent);
|
||||
}
|
||||
fmt_final_comments_spaces(buf, final_comments.iter(), field_indent);
|
||||
|
||||
newline(buf, indent);
|
||||
} else
|
||||
// is_multiline == false
|
||||
|
@ -885,17 +883,12 @@ fn format_field_multiline<'a, T>(
|
|||
buf.push(',');
|
||||
}
|
||||
AssignedField::SpaceBefore(sub_field, spaces) => {
|
||||
if spaces.iter().any(|s| s.is_comment()) {
|
||||
fmt_condition_spaces(buf, spaces.iter(), indent);
|
||||
}
|
||||
fmt_final_comments_spaces(buf, spaces.iter(), indent);
|
||||
format_field_multiline(buf, sub_field, indent, separator_prefix);
|
||||
}
|
||||
AssignedField::SpaceAfter(sub_field, spaces) => {
|
||||
format_field_multiline(buf, sub_field, indent, separator_prefix);
|
||||
if spaces.iter().any(|s| s.is_comment()) {
|
||||
newline(buf, indent);
|
||||
fmt_condition_spaces(buf, spaces.iter(), indent);
|
||||
}
|
||||
fmt_final_comments_spaces(buf, spaces.iter(), indent);
|
||||
}
|
||||
Malformed(raw) => {
|
||||
buf.push_str(raw);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue