Merge remote-tracking branch 'remote/main' into builtin-task

This commit is contained in:
Luke Boswell 2024-07-19 19:51:50 +10:00
commit b489c44b19
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
262 changed files with 11354 additions and 5821 deletions

View file

@ -89,8 +89,21 @@ pub enum CalledVia {
/// e.g. "$(first) $(last)" is transformed into Str.concat (Str.concat first " ") last.
StringInterpolation,
/// This call is the result of desugaring a Record Builder field.
/// This call is the result of desugaring an old style Record Builder field.
/// e.g. succeed { a <- get "a" } is transformed into (get "a") (succeed \a -> { a })
OldRecordBuilder,
/// This call is the result of desugaring a map2-based Record Builder field. e.g.
/// ```roc
/// { Task.parallel <-
/// foo: get "a",
/// bar: get "b",
/// }
/// ```
/// is transformed into
/// ```roc
/// Task.parallel (get "a") (get "b") \foo, bar -> { foo, bar }
/// ```
RecordBuilder,
/// This call is the result of desugaring a Task.await from `!` syntax

View file

@ -36,10 +36,6 @@ pub enum LowLevel {
ListReplaceUnsafe,
ListConcat,
ListPrepend,
ListMap,
ListMap2,
ListMap3,
ListMap4,
ListSortWith,
ListSublist,
ListDropAt,
@ -48,6 +44,8 @@ pub enum LowLevel {
ListIsUnique,
ListClone,
ListConcatUtf8,
ListIncref,
ListDecref,
NumAdd,
NumAddWrap,
NumAddChecked,
@ -135,7 +133,7 @@ pub enum LowLevel {
macro_rules! higher_order {
() => {
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith
ListSortWith
};
}
@ -152,10 +150,6 @@ impl LowLevel {
use LowLevel::*;
match self {
ListMap => 1,
ListMap2 => 2,
ListMap3 => 3,
ListMap4 => 4,
ListSortWith => 1,
_ => unreachable!(),
}
@ -211,10 +205,6 @@ macro_rules! map_symbol_to_lowlevel {
// these are higher-order lowlevels. these need the surrounding
// function to provide enough type information for code generation
LowLevel::ListMap => unreachable!(),
LowLevel::ListMap2 => unreachable!(),
LowLevel::ListMap3 => unreachable!(),
LowLevel::ListMap4 => unreachable!(),
LowLevel::ListSortWith => unreachable!(),
// (un)boxing is handled in a custom way
@ -239,6 +229,8 @@ macro_rules! map_symbol_to_lowlevel {
LowLevel::RefCountIncDataPtr => unimplemented!(),
LowLevel::RefCountDecDataPtr=> unimplemented!(),
LowLevel::RefCountIsUnique => unimplemented!(),
LowLevel::ListIncref => unimplemented!(),
LowLevel::ListDecref => unimplemented!(),
LowLevel::SetJmp => unimplemented!(),
LowLevel::LongJmp => unimplemented!(),