mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Make Expr::List use a Collection
This commit is contained in:
parent
a4ca6a31a6
commit
d63405d824
8 changed files with 29 additions and 67 deletions
|
@ -144,20 +144,17 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
|
|||
|
||||
arena.alloc(Located { region, value })
|
||||
}
|
||||
List {
|
||||
items,
|
||||
final_comments,
|
||||
} => {
|
||||
List(items) => {
|
||||
let mut new_items = Vec::with_capacity_in(items.len(), arena);
|
||||
|
||||
for item in items.iter() {
|
||||
new_items.push(desugar_expr(arena, item));
|
||||
}
|
||||
let new_items = new_items.into_bump_slice();
|
||||
let value: Expr<'a> = List {
|
||||
let value: Expr<'a> = List(Collection {
|
||||
items: new_items,
|
||||
final_comments,
|
||||
};
|
||||
final_comments: items.final_comments,
|
||||
});
|
||||
|
||||
arena.alloc(Located {
|
||||
region: loc_expr.region,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue