mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
add TrailingComma to Record & little formatter refactor
This commit is contained in:
parent
a788407caa
commit
6ad1bb233a
6 changed files with 84 additions and 54 deletions
|
@ -123,7 +123,7 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
|
|||
value,
|
||||
})
|
||||
}
|
||||
Record { fields, update } | Nested(Record { fields, update }) => {
|
||||
Record { fields, update, trailing_comma } | Nested(Record { fields, update, trailing_comma }) => {
|
||||
let mut new_fields = Vec::with_capacity_in(fields.len(), arena);
|
||||
|
||||
for field in fields.iter() {
|
||||
|
@ -142,6 +142,7 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
|
|||
value: Record {
|
||||
update: *update,
|
||||
fields: new_fields,
|
||||
trailing_comma: trailing_comma,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue