mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Fix the build, but List.dropLast itself still doesn't work.
This commit is contained in:
parent
fd83c3b749
commit
9633a5adaa
2 changed files with 6 additions and 1 deletions
|
@ -88,6 +88,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
|
|||
LIST_MAP3 => list_map3,
|
||||
LIST_DROP => list_drop,
|
||||
LIST_DROP_AT => list_drop_at,
|
||||
LIST_DROP_LAST => list_drop_last,
|
||||
LIST_SWAP => list_swap,
|
||||
LIST_MAP_WITH_INDEX => list_map_with_index,
|
||||
LIST_KEEP_IF => list_keep_if,
|
||||
|
@ -2007,6 +2008,11 @@ fn list_drop_at(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
|||
/// List.dropLast: List elem -> List elem
|
||||
fn list_drop_last(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
let list_var = var_store.fresh();
|
||||
let index_var = var_store.fresh();
|
||||
let arg_var = var_store.fresh();
|
||||
let len_var = Variable::NAT;
|
||||
let num_var = len_var;
|
||||
let num_precision_var = Variable::NATURAL;
|
||||
|
||||
let body = RunLowLevel {
|
||||
op: LowLevel::ListDropAt,
|
||||
|
|
|
@ -947,7 +947,6 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] {
|
|||
ListAppend => arena.alloc_slice_copy(&[owned, owned]),
|
||||
ListDrop => arena.alloc_slice_copy(&[owned, irrelevant]),
|
||||
ListDropAt => arena.alloc_slice_copy(&[owned, irrelevant]),
|
||||
ListDropLast => arena.alloc_slice_copy(&[owned]),
|
||||
ListSwap => arena.alloc_slice_copy(&[owned, irrelevant, irrelevant]),
|
||||
|
||||
Eq | NotEq => arena.alloc_slice_copy(&[borrowed, borrowed]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue