mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Expose capacity builtins
This commit is contained in:
parent
6ac9c37e06
commit
25facfa9c6
8 changed files with 67 additions and 1 deletions
|
@ -29,6 +29,7 @@ pub enum LowLevel {
|
|||
StrReserve,
|
||||
StrAppendScalar,
|
||||
StrGetScalarUnsafe,
|
||||
StrGetCapacity,
|
||||
ListLen,
|
||||
ListWithCapacity,
|
||||
ListReserve,
|
||||
|
@ -46,6 +47,7 @@ pub enum LowLevel {
|
|||
ListDropAt,
|
||||
ListSwap,
|
||||
ListIsUnique,
|
||||
ListGetCapacity,
|
||||
DictSize,
|
||||
DictEmpty,
|
||||
DictInsert,
|
||||
|
@ -58,8 +60,10 @@ pub enum LowLevel {
|
|||
DictIntersection,
|
||||
DictDifference,
|
||||
DictWalk,
|
||||
DictGetCapacity,
|
||||
SetFromList,
|
||||
SetToDict,
|
||||
SetGetCapacity,
|
||||
NumAdd,
|
||||
NumAddWrap,
|
||||
NumAddChecked,
|
||||
|
@ -263,7 +267,9 @@ map_symbol_to_lowlevel! {
|
|||
StrAppendScalar <= STR_APPEND_SCALAR_UNSAFE,
|
||||
StrGetScalarUnsafe <= STR_GET_SCALAR_UNSAFE,
|
||||
StrToNum <= STR_TO_NUM,
|
||||
StrGetCapacity <= STR_CAPACITY,
|
||||
ListLen <= LIST_LEN,
|
||||
ListGetCapacity <= LIST_CAPACITY,
|
||||
ListWithCapacity <= LIST_WITH_CAPACITY,
|
||||
ListReserve <= LIST_RESERVE,
|
||||
ListIsUnique <= LIST_IS_UNIQUE,
|
||||
|
@ -285,8 +291,10 @@ map_symbol_to_lowlevel! {
|
|||
DictUnion <= DICT_UNION,
|
||||
DictIntersection <= DICT_INTERSECTION,
|
||||
DictDifference <= DICT_DIFFERENCE,
|
||||
DictGetCapacity <= DICT_CAPACITY,
|
||||
SetFromList <= SET_FROM_LIST,
|
||||
SetToDict <= SET_TO_DICT,
|
||||
SetGetCapacity <= SET_CAPACITY,
|
||||
NumAdd <= NUM_ADD,
|
||||
NumAddWrap <= NUM_ADD_WRAP,
|
||||
NumAddChecked <= NUM_ADD_CHECKED_LOWLEVEL,
|
||||
|
|
|
@ -1215,6 +1215,7 @@ define_builtins! {
|
|||
46 STR_WALK_SCALARS_UNTIL: "walkScalarsUntil"
|
||||
47 STR_TO_NUM: "strToNum"
|
||||
48 STR_FROM_UTF8_RANGE_LOWLEVEL: "fromUtf8RangeLowlevel"
|
||||
49 STR_CAPACITY: "capacity"
|
||||
}
|
||||
5 LIST: "List" => {
|
||||
0 LIST_LIST: "List" imported // the List.List type alias
|
||||
|
@ -1285,6 +1286,7 @@ define_builtins! {
|
|||
65 LIST_RESERVE: "reserve"
|
||||
66 LIST_APPEND_UNSAFE: "appendUnsafe"
|
||||
67 LIST_SUBLIST_LOWLEVEL: "sublistLowlevel"
|
||||
68 LIST_CAPACITY: "capacity"
|
||||
}
|
||||
6 RESULT: "Result" => {
|
||||
0 RESULT_RESULT: "Result" // the Result.Result type alias
|
||||
|
@ -1320,6 +1322,7 @@ define_builtins! {
|
|||
14 DICT_DIFFERENCE: "difference"
|
||||
|
||||
15 DICT_GET_LOWLEVEL: "getLowlevel"
|
||||
16 DICT_CAPACITY: "capacity"
|
||||
}
|
||||
8 SET: "Set" => {
|
||||
0 SET_SET: "Set" imported // the Set.Set type alias
|
||||
|
@ -1337,6 +1340,7 @@ define_builtins! {
|
|||
12 SET_WALK_USER_FUNCTION: "#walk_user_function"
|
||||
13 SET_CONTAINS: "contains"
|
||||
14 SET_TO_DICT: "toDict"
|
||||
15 SET_CAPACITY: "capacity"
|
||||
}
|
||||
9 BOX: "Box" => {
|
||||
0 BOX_BOX_TYPE: "Box" imported // the Box.Box opaque type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue