mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Merge branch 'trunk' of github.com:rtfeldman/roc into list_keepIf
This commit is contained in:
commit
5bd88c8901
42 changed files with 1818 additions and 965 deletions
|
@ -496,11 +496,11 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] {
|
|||
ListSet => arena.alloc_slice_copy(&[owned, irrelevant, irrelevant]),
|
||||
ListSetInPlace => arena.alloc_slice_copy(&[owned, irrelevant, irrelevant]),
|
||||
ListGetUnsafe => arena.alloc_slice_copy(&[borrowed, irrelevant]),
|
||||
ListConcat | StrConcat => arena.alloc_slice_copy(&[owned, borrowed]),
|
||||
|
||||
ListSingle => arena.alloc_slice_copy(&[irrelevant]),
|
||||
ListRepeat => arena.alloc_slice_copy(&[irrelevant, irrelevant]),
|
||||
ListReverse => arena.alloc_slice_copy(&[owned]),
|
||||
ListConcat | StrConcat => arena.alloc_slice_copy(&[irrelevant, irrelevant]),
|
||||
ListAppend => arena.alloc_slice_copy(&[owned, owned]),
|
||||
ListPrepend => arena.alloc_slice_copy(&[owned, owned]),
|
||||
ListJoin => arena.alloc_slice_copy(&[irrelevant]),
|
||||
|
|
|
@ -585,6 +585,7 @@ pub enum Stmt<'a> {
|
|||
Jump(JoinPointId, &'a [Symbol]),
|
||||
RuntimeError(&'a str),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Literal<'a> {
|
||||
// Literals
|
||||
|
@ -1242,7 +1243,7 @@ pub fn with_hole<'a>(
|
|||
hole,
|
||||
),
|
||||
|
||||
Str(string) | BlockStr(string) => Stmt::Let(
|
||||
Str(string) => Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Str(arena.alloc(string))),
|
||||
Layout::Builtin(Builtin::Str),
|
||||
|
|
|
@ -311,7 +311,7 @@ fn layout_from_flat_type<'a>(
|
|||
// Num.Num should only ever have 1 argument, e.g. Num.Num Int.Integer
|
||||
debug_assert_eq!(args.len(), 1);
|
||||
|
||||
let var = args.get(0).unwrap();
|
||||
let var = args.first().unwrap();
|
||||
let content = subs.get_without_compacting(*var).content;
|
||||
|
||||
layout_from_num_content(content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue