mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
correctly parse trailing commas in record
This commit is contained in:
parent
7ec161c415
commit
58acc59b01
8 changed files with 135 additions and 57 deletions
|
@ -123,7 +123,16 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
|
|||
value,
|
||||
})
|
||||
}
|
||||
Record { fields, update, trailing_comma } | Nested(Record { fields, update, trailing_comma }) => {
|
||||
Record {
|
||||
fields,
|
||||
update,
|
||||
final_comments,
|
||||
}
|
||||
| Nested(Record {
|
||||
fields,
|
||||
update,
|
||||
final_comments,
|
||||
}) => {
|
||||
let mut new_fields = Vec::with_capacity_in(fields.len(), arena);
|
||||
|
||||
for field in fields.iter() {
|
||||
|
@ -142,7 +151,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,
|
||||
final_comments,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue