mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +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
|
@ -133,10 +133,7 @@ fn jit_to_ast_help<'a>(
|
|||
),
|
||||
Layout::Builtin(Builtin::EmptyList) => {
|
||||
Ok(run_jit_function!(lib, main_fn_name, &'static str, |_| {
|
||||
Expr::List {
|
||||
items: &[],
|
||||
final_comments: &[],
|
||||
}
|
||||
Expr::List(Collection::empty())
|
||||
}))
|
||||
}
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => Ok(run_jit_function!(
|
||||
|
@ -431,10 +428,7 @@ fn ptr_to_ast<'a>(
|
|||
|
||||
num_to_ast(env, number_literal_to_ast(env.arena, num), content)
|
||||
}
|
||||
Layout::Builtin(Builtin::EmptyList) => Expr::List {
|
||||
items: &[],
|
||||
final_comments: &[],
|
||||
},
|
||||
Layout::Builtin(Builtin::EmptyList) => Expr::List(Collection::empty()),
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => {
|
||||
// Turn the (ptr, len) wrapper struct into actual ptr and len values.
|
||||
let len = unsafe { *(ptr.offset(env.ptr_bytes as isize) as *const usize) };
|
||||
|
@ -522,10 +516,7 @@ fn list_to_ast<'a>(
|
|||
|
||||
let output = output.into_bump_slice();
|
||||
|
||||
Expr::List {
|
||||
items: output,
|
||||
final_comments: &[],
|
||||
}
|
||||
Expr::List(Collection::with_items(output))
|
||||
}
|
||||
|
||||
fn single_tag_union_to_ast<'a>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue