mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Ignore underscore-prefixed fields in record builders
This commit is contained in:
parent
13f60cde09
commit
cb8040f629
16 changed files with 336 additions and 140 deletions
|
@ -1529,6 +1529,23 @@ fn format_assigned_field_multiline<T>(
|
|||
ann.value.format(buf, indent);
|
||||
buf.push(',');
|
||||
}
|
||||
IgnoredValue(name, spaces, ann) => {
|
||||
buf.newline();
|
||||
buf.indent(indent);
|
||||
buf.push('_');
|
||||
buf.push_str(name.value);
|
||||
|
||||
if !spaces.is_empty() {
|
||||
fmt_spaces(buf, spaces.iter(), indent);
|
||||
buf.indent(indent);
|
||||
}
|
||||
|
||||
buf.push_str(separator_prefix);
|
||||
buf.push_str(":");
|
||||
buf.spaces(1);
|
||||
ann.value.format(buf, indent);
|
||||
buf.push(',');
|
||||
}
|
||||
LabelOnly(name) => {
|
||||
buf.newline();
|
||||
buf.indent(indent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue