mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Merge remote-tracking branch 'origin/trunk' into list-unreachable
This commit is contained in:
commit
3a30e77726
57 changed files with 975 additions and 520 deletions
|
@ -13,6 +13,7 @@ pub enum LowLevel {
|
|||
StrEndsWith,
|
||||
StrSplit,
|
||||
StrCountGraphemes,
|
||||
StrCountUtf8Bytes,
|
||||
StrFromInt,
|
||||
StrFromUtf8,
|
||||
StrFromUtf8Range,
|
||||
|
@ -24,6 +25,11 @@ pub enum LowLevel {
|
|||
StrTrimRight,
|
||||
StrToNum,
|
||||
StrToScalars,
|
||||
StrGetUnsafe,
|
||||
StrSubstringUnsafe,
|
||||
StrReserve,
|
||||
StrAppendScalar,
|
||||
StrGetScalarUnsafe,
|
||||
ListLen,
|
||||
ListWithCapacity,
|
||||
ListGetUnsafe,
|
||||
|
@ -35,7 +41,6 @@ pub enum LowLevel {
|
|||
ListMap2,
|
||||
ListMap3,
|
||||
ListMap4,
|
||||
ListMapWithIndex,
|
||||
ListSortWith,
|
||||
ListSublist,
|
||||
ListDropAt,
|
||||
|
@ -121,7 +126,7 @@ pub enum LowLevel {
|
|||
|
||||
macro_rules! higher_order {
|
||||
() => {
|
||||
ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk
|
||||
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -142,7 +147,6 @@ impl LowLevel {
|
|||
ListMap2 => 2,
|
||||
ListMap3 => 3,
|
||||
ListMap4 => 4,
|
||||
ListMapWithIndex => 1,
|
||||
ListSortWith => 1,
|
||||
DictWalk => 2,
|
||||
_ => unreachable!(),
|
||||
|
@ -168,6 +172,7 @@ impl LowLevelWrapperType {
|
|||
|
||||
match symbol {
|
||||
Symbol::STR_CONCAT => CanBeReplacedBy(StrConcat),
|
||||
Symbol::STR_GET_UNSAFE => CanBeReplacedBy(StrGetUnsafe),
|
||||
Symbol::STR_TO_SCALARS => CanBeReplacedBy(StrToScalars),
|
||||
Symbol::STR_JOIN_WITH => CanBeReplacedBy(StrJoinWith),
|
||||
Symbol::STR_IS_EMPTY => CanBeReplacedBy(StrIsEmpty),
|
||||
|
@ -176,10 +181,13 @@ impl LowLevelWrapperType {
|
|||
Symbol::STR_ENDS_WITH => CanBeReplacedBy(StrEndsWith),
|
||||
Symbol::STR_SPLIT => CanBeReplacedBy(StrSplit),
|
||||
Symbol::STR_COUNT_GRAPHEMES => CanBeReplacedBy(StrCountGraphemes),
|
||||
Symbol::STR_COUNT_UTF8_BYTES => CanBeReplacedBy(StrCountUtf8Bytes),
|
||||
Symbol::STR_FROM_UTF8 => WrapperIsRequired,
|
||||
Symbol::STR_FROM_UTF8_RANGE => WrapperIsRequired,
|
||||
Symbol::STR_TO_UTF8 => CanBeReplacedBy(StrToUtf8),
|
||||
Symbol::STR_REPEAT => CanBeReplacedBy(StrRepeat),
|
||||
Symbol::STR_RESERVE => CanBeReplacedBy(StrReserve),
|
||||
Symbol::STR_APPEND_SCALAR_UNSAFE => CanBeReplacedBy(StrAppendScalar),
|
||||
Symbol::STR_TRIM => CanBeReplacedBy(StrTrim),
|
||||
Symbol::STR_TRIM_LEFT => CanBeReplacedBy(StrTrimLeft),
|
||||
Symbol::STR_TRIM_RIGHT => CanBeReplacedBy(StrTrimRight),
|
||||
|
@ -207,7 +215,6 @@ impl LowLevelWrapperType {
|
|||
Symbol::LIST_MAP2 => WrapperIsRequired,
|
||||
Symbol::LIST_MAP3 => WrapperIsRequired,
|
||||
Symbol::LIST_MAP4 => WrapperIsRequired,
|
||||
Symbol::LIST_MAP_WITH_INDEX => WrapperIsRequired,
|
||||
Symbol::LIST_SORT_WITH => WrapperIsRequired,
|
||||
Symbol::LIST_SUBLIST => WrapperIsRequired,
|
||||
Symbol::LIST_DROP_AT => CanBeReplacedBy(ListDropAt),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue