mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Merge branch 'trunk' into refactor-builtin-list-drop
This commit is contained in:
commit
1a3f2aed4f
4 changed files with 195 additions and 219 deletions
|
@ -227,88 +227,18 @@ where
|
||||||
ret_layout,
|
ret_layout,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
// For most builtins instead of calling a function, we can just inline the low level.
|
// If this function is just a lowlevel wrapper, then inline it
|
||||||
match *func_sym {
|
if let Some(lowlevel) = LowLevel::from_inlined_wrapper(*func_sym) {
|
||||||
Symbol::NUM_ABS => self.build_run_low_level(
|
self.build_run_low_level(
|
||||||
sym,
|
sym,
|
||||||
&LowLevel::NumAbs,
|
&lowlevel,
|
||||||
arguments,
|
arguments,
|
||||||
arg_layouts,
|
arg_layouts,
|
||||||
ret_layout,
|
ret_layout,
|
||||||
),
|
)
|
||||||
Symbol::NUM_ADD => self.build_run_low_level(
|
} else if func_sym
|
||||||
sym,
|
|
||||||
&LowLevel::NumAdd,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_ACOS => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumAcos,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_ASIN => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumAsin,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_ATAN => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumAtan,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_MUL => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumMul,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_POW_INT => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumPowInt,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_SUB => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumSub,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::NUM_ROUND => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::NumRound,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::BOOL_EQ => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::Eq,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
Symbol::STR_CONCAT => self.build_run_low_level(
|
|
||||||
sym,
|
|
||||||
&LowLevel::StrConcat,
|
|
||||||
arguments,
|
|
||||||
arg_layouts,
|
|
||||||
ret_layout,
|
|
||||||
),
|
|
||||||
x if x
|
|
||||||
.module_string(&self.env().interns)
|
.module_string(&self.env().interns)
|
||||||
.starts_with(ModuleName::APP) =>
|
.starts_with(ModuleName::APP)
|
||||||
{
|
{
|
||||||
let fn_name = LayoutIds::default()
|
let fn_name = LayoutIds::default()
|
||||||
.get(*func_sym, layout)
|
.get(*func_sym, layout)
|
||||||
|
@ -316,8 +246,11 @@ where
|
||||||
// Now that the arguments are needed, load them if they are literals.
|
// Now that the arguments are needed, load them if they are literals.
|
||||||
self.load_literal_symbols(arguments)?;
|
self.load_literal_symbols(arguments)?;
|
||||||
self.build_fn_call(sym, fn_name, arguments, arg_layouts, ret_layout)
|
self.build_fn_call(sym, fn_name, arguments, arg_layouts, ret_layout)
|
||||||
}
|
} else {
|
||||||
x => Err(format!("the function, {:?}, is not yet implemented", x)),
|
Err(format!(
|
||||||
|
"the function, {:?}, is not yet implemented",
|
||||||
|
func_sym
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,13 @@ use bumpalo::{self, collections::Vec};
|
||||||
|
|
||||||
use code_builder::Align;
|
use code_builder::Align;
|
||||||
use roc_collections::all::MutMap;
|
use roc_collections::all::MutMap;
|
||||||
|
use roc_module::low_level::LowLevel;
|
||||||
use roc_module::symbol::Symbol;
|
use roc_module::symbol::Symbol;
|
||||||
use roc_mono::ir::{CallType, Expr, JoinPointId, Literal, Proc, Stmt};
|
use roc_mono::ir::{CallType, Expr, JoinPointId, Literal, Proc, Stmt};
|
||||||
use roc_mono::layout::{Builtin, Layout, LayoutIds};
|
use roc_mono::layout::{Builtin, Layout, LayoutIds};
|
||||||
|
|
||||||
use crate::layout::WasmLayout;
|
use crate::layout::WasmLayout;
|
||||||
use crate::low_level::{build_call_low_level, LowlevelBuildResult};
|
use crate::low_level::{decode_low_level, LowlevelBuildResult};
|
||||||
use crate::storage::{Storage, StoredValue, StoredValueKind};
|
use crate::storage::{Storage, StoredValue, StoredValueKind};
|
||||||
use crate::wasm_module::linking::{
|
use crate::wasm_module::linking::{
|
||||||
DataSymbol, LinkingSection, RelocationSection, WasmObjectSymbol, WASM_SYM_BINDING_WEAK,
|
DataSymbol, LinkingSection, RelocationSection, WasmObjectSymbol, WASM_SYM_BINDING_WEAK,
|
||||||
|
@ -469,6 +470,11 @@ impl<'a> WasmBackend<'a> {
|
||||||
arguments,
|
arguments,
|
||||||
}) => match call_type {
|
}) => match call_type {
|
||||||
CallType::ByName { name: func_sym, .. } => {
|
CallType::ByName { name: func_sym, .. } => {
|
||||||
|
// If this function is just a lowlevel wrapper, then inline it
|
||||||
|
if let Some(lowlevel) = LowLevel::from_inlined_wrapper(*func_sym) {
|
||||||
|
return self.build_low_level(lowlevel, arguments, wasm_layout);
|
||||||
|
}
|
||||||
|
|
||||||
let mut wasm_args_tmp: Vec<Symbol>;
|
let mut wasm_args_tmp: Vec<Symbol>;
|
||||||
let (wasm_args, has_return_val) = match wasm_layout {
|
let (wasm_args, has_return_val) = match wasm_layout {
|
||||||
WasmLayout::StackMemory { .. } => {
|
WasmLayout::StackMemory { .. } => {
|
||||||
|
@ -511,30 +517,9 @@ impl<'a> WasmBackend<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
CallType::LowLevel { op: lowlevel, .. } => {
|
CallType::LowLevel { op: lowlevel, .. } => {
|
||||||
let return_layout = WasmLayout::new(layout);
|
self.build_low_level(*lowlevel, arguments, wasm_layout)
|
||||||
self.storage.load_symbols(&mut self.code_builder, arguments);
|
}
|
||||||
|
|
||||||
let build_result = build_call_low_level(
|
|
||||||
&mut self.code_builder,
|
|
||||||
&mut self.storage,
|
|
||||||
lowlevel,
|
|
||||||
arguments,
|
|
||||||
&return_layout,
|
|
||||||
);
|
|
||||||
use LowlevelBuildResult::*;
|
|
||||||
|
|
||||||
match build_result {
|
|
||||||
Done => Ok(()),
|
|
||||||
BuiltinCall(name) => {
|
|
||||||
self.call_imported_builtin(name, arguments, &return_layout);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
NotImplemented => Err(format!(
|
|
||||||
"Low level operation {:?} is not yet implemented",
|
|
||||||
lowlevel
|
|
||||||
)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
x => Err(format!("the call type, {:?}, is not yet implemented", x)),
|
x => Err(format!("the call type, {:?}, is not yet implemented", x)),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -567,6 +552,36 @@ impl<'a> WasmBackend<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn build_low_level(
|
||||||
|
&mut self,
|
||||||
|
lowlevel: LowLevel,
|
||||||
|
arguments: &'a [Symbol],
|
||||||
|
return_layout: WasmLayout,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
self.storage.load_symbols(&mut self.code_builder, arguments);
|
||||||
|
|
||||||
|
let build_result = decode_low_level(
|
||||||
|
&mut self.code_builder,
|
||||||
|
&mut self.storage,
|
||||||
|
lowlevel,
|
||||||
|
arguments,
|
||||||
|
&return_layout,
|
||||||
|
);
|
||||||
|
use LowlevelBuildResult::*;
|
||||||
|
|
||||||
|
match build_result {
|
||||||
|
Done => Ok(()),
|
||||||
|
BuiltinCall(name) => {
|
||||||
|
self.call_imported_builtin(name, arguments, &return_layout);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
NotImplemented => Err(format!(
|
||||||
|
"Low level operation {:?} is not yet implemented",
|
||||||
|
lowlevel
|
||||||
|
)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn load_literal(
|
fn load_literal(
|
||||||
&mut self,
|
&mut self,
|
||||||
lit: &Literal<'a>,
|
lit: &Literal<'a>,
|
||||||
|
@ -764,14 +779,15 @@ impl<'a> WasmBackend<'a> {
|
||||||
};
|
};
|
||||||
self.module.import.entries.push(import);
|
self.module.import.entries.push(import);
|
||||||
|
|
||||||
let sym_idx = self.linker_symbols.len() as u32;
|
let sym_idx = self.linker_symbols.len();
|
||||||
let sym_info = SymInfo::Function(WasmObjectSymbol::Imported {
|
let sym_info = SymInfo::Function(WasmObjectSymbol::Imported {
|
||||||
flags: WASM_SYM_UNDEFINED,
|
flags: WASM_SYM_UNDEFINED,
|
||||||
index: import_index,
|
index: import_index,
|
||||||
});
|
});
|
||||||
self.linker_symbols.push(sym_info);
|
self.linker_symbols.push(sym_info);
|
||||||
|
self.builtin_sym_index_map.insert(name, sym_idx);
|
||||||
|
|
||||||
(import_index, sym_idx)
|
(import_index, sym_idx as u32)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
self.code_builder.call(
|
self.code_builder.call(
|
||||||
|
|
|
@ -15,10 +15,10 @@ pub enum LowlevelBuildResult {
|
||||||
NotImplemented,
|
NotImplemented,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_call_low_level<'a>(
|
pub fn decode_low_level<'a>(
|
||||||
code_builder: &mut CodeBuilder<'a>,
|
code_builder: &mut CodeBuilder<'a>,
|
||||||
storage: &mut Storage<'a>,
|
storage: &mut Storage<'a>,
|
||||||
lowlevel: &LowLevel,
|
lowlevel: LowLevel,
|
||||||
args: &'a [Symbol],
|
args: &'a [Symbol],
|
||||||
ret_layout: &WasmLayout,
|
ret_layout: &WasmLayout,
|
||||||
) -> LowlevelBuildResult {
|
) -> LowlevelBuildResult {
|
||||||
|
@ -129,6 +129,9 @@ pub fn build_call_low_level<'a>(
|
||||||
NumIsMultipleOf => return NotImplemented,
|
NumIsMultipleOf => return NotImplemented,
|
||||||
NumAbs => match ret_layout.value_type() {
|
NumAbs => match ret_layout.value_type() {
|
||||||
I32 => {
|
I32 => {
|
||||||
|
let arg_storage = storage.get(&args[0]).to_owned();
|
||||||
|
storage.ensure_value_has_local(code_builder, args[0], arg_storage);
|
||||||
|
storage.load_symbols(code_builder, args);
|
||||||
code_builder.i32_const(0);
|
code_builder.i32_const(0);
|
||||||
storage.load_symbols(code_builder, args);
|
storage.load_symbols(code_builder, args);
|
||||||
code_builder.i32_sub();
|
code_builder.i32_sub();
|
||||||
|
@ -138,6 +141,9 @@ pub fn build_call_low_level<'a>(
|
||||||
code_builder.select();
|
code_builder.select();
|
||||||
}
|
}
|
||||||
I64 => {
|
I64 => {
|
||||||
|
let arg_storage = storage.get(&args[0]).to_owned();
|
||||||
|
storage.ensure_value_has_local(code_builder, args[0], arg_storage);
|
||||||
|
storage.load_symbols(code_builder, args);
|
||||||
code_builder.i64_const(0);
|
code_builder.i64_const(0);
|
||||||
storage.load_symbols(code_builder, args);
|
storage.load_symbols(code_builder, args);
|
||||||
code_builder.i64_sub();
|
code_builder.i64_sub();
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use crate::symbol::Symbol;
|
||||||
|
|
||||||
/// Low-level operations that get translated directly into e.g. LLVM instructions.
|
/// Low-level operations that get translated directly into e.g. LLVM instructions.
|
||||||
/// These are always wrapped when exposed to end users, and can only make it
|
/// These are always wrapped when exposed to end users, and can only make it
|
||||||
/// into an Expr when added directly by can::builtins
|
/// into an Expr when added directly by can::builtins
|
||||||
|
@ -114,105 +116,6 @@ pub enum LowLevel {
|
||||||
ExpectTrue,
|
ExpectTrue,
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! first_order {
|
|
||||||
() => {
|
|
||||||
StrConcat
|
|
||||||
| StrJoinWith
|
|
||||||
| StrIsEmpty
|
|
||||||
| StrStartsWith
|
|
||||||
| StrStartsWithCodePt
|
|
||||||
| StrEndsWith
|
|
||||||
| StrSplit
|
|
||||||
| StrCountGraphemes
|
|
||||||
| StrFromInt
|
|
||||||
| StrFromUtf8
|
|
||||||
| StrFromUtf8Range
|
|
||||||
| StrToUtf8
|
|
||||||
| StrRepeat
|
|
||||||
| StrTrim
|
|
||||||
| StrTrimLeft
|
|
||||||
| StrTrimRight
|
|
||||||
| StrFromFloat
|
|
||||||
| ListLen
|
|
||||||
| ListGetUnsafe
|
|
||||||
| ListSet
|
|
||||||
| ListSublist
|
|
||||||
| ListDropAt
|
|
||||||
| ListSingle
|
|
||||||
| ListRepeat
|
|
||||||
| ListReverse
|
|
||||||
| ListConcat
|
|
||||||
| ListContains
|
|
||||||
| ListAppend
|
|
||||||
| ListPrepend
|
|
||||||
| ListJoin
|
|
||||||
| ListRange
|
|
||||||
| ListSwap
|
|
||||||
| DictSize
|
|
||||||
| DictEmpty
|
|
||||||
| DictInsert
|
|
||||||
| DictRemove
|
|
||||||
| DictContains
|
|
||||||
| DictGetUnsafe
|
|
||||||
| DictKeys
|
|
||||||
| DictValues
|
|
||||||
| DictUnion
|
|
||||||
| DictIntersection
|
|
||||||
| DictDifference
|
|
||||||
| SetFromList
|
|
||||||
| NumAdd
|
|
||||||
| NumAddWrap
|
|
||||||
| NumAddChecked
|
|
||||||
| NumSub
|
|
||||||
| NumSubWrap
|
|
||||||
| NumSubChecked
|
|
||||||
| NumMul
|
|
||||||
| NumMulWrap
|
|
||||||
| NumMulChecked
|
|
||||||
| NumGt
|
|
||||||
| NumGte
|
|
||||||
| NumLt
|
|
||||||
| NumLte
|
|
||||||
| NumCompare
|
|
||||||
| NumDivUnchecked
|
|
||||||
| NumDivCeilUnchecked
|
|
||||||
| NumRemUnchecked
|
|
||||||
| NumIsMultipleOf
|
|
||||||
| NumAbs
|
|
||||||
| NumNeg
|
|
||||||
| NumSin
|
|
||||||
| NumCos
|
|
||||||
| NumSqrtUnchecked
|
|
||||||
| NumLogUnchecked
|
|
||||||
| NumRound
|
|
||||||
| NumToFloat
|
|
||||||
| NumPow
|
|
||||||
| NumCeiling
|
|
||||||
| NumPowInt
|
|
||||||
| NumFloor
|
|
||||||
| NumIsFinite
|
|
||||||
| NumAtan
|
|
||||||
| NumAcos
|
|
||||||
| NumAsin
|
|
||||||
| NumBitwiseAnd
|
|
||||||
| NumBitwiseXor
|
|
||||||
| NumBitwiseOr
|
|
||||||
| NumShiftLeftBy
|
|
||||||
| NumShiftRightBy
|
|
||||||
| NumBytesToU16
|
|
||||||
| NumBytesToU32
|
|
||||||
| NumShiftRightZfBy
|
|
||||||
| NumIntCast
|
|
||||||
| Eq
|
|
||||||
| NotEq
|
|
||||||
| And
|
|
||||||
| Or
|
|
||||||
| Not
|
|
||||||
| Hash
|
|
||||||
| ExpectTrue
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! higher_order {
|
macro_rules! higher_order {
|
||||||
() => {
|
() => {
|
||||||
ListMap
|
ListMap
|
||||||
|
@ -239,17 +142,13 @@ impl LowLevel {
|
||||||
pub fn is_higher_order(&self) -> bool {
|
pub fn is_higher_order(&self) -> bool {
|
||||||
use LowLevel::*;
|
use LowLevel::*;
|
||||||
|
|
||||||
match self {
|
matches!(self, higher_order!())
|
||||||
first_order!() => false,
|
|
||||||
higher_order!() => true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn function_argument_position(&self) -> usize {
|
pub fn function_argument_position(&self) -> usize {
|
||||||
use LowLevel::*;
|
use LowLevel::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
first_order!() => unreachable!(),
|
|
||||||
ListMap => 1,
|
ListMap => 1,
|
||||||
ListMap2 => 2,
|
ListMap2 => 2,
|
||||||
ListMap3 => 3,
|
ListMap3 => 3,
|
||||||
|
@ -265,6 +164,128 @@ impl LowLevel {
|
||||||
ListAny => 1,
|
ListAny => 1,
|
||||||
ListFindUnsafe => 1,
|
ListFindUnsafe => 1,
|
||||||
DictWalk => 2,
|
DictWalk => 2,
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used in dev backends to inline some lowlevel wrapper functions
|
||||||
|
/// For wrappers that contain logic, we return None to prevent inlining
|
||||||
|
/// (Mention each explicitly rather than using `_`, to show they have not been forgotten)
|
||||||
|
pub fn from_inlined_wrapper(symbol: Symbol) -> Option<LowLevel> {
|
||||||
|
use LowLevel::*;
|
||||||
|
|
||||||
|
match symbol {
|
||||||
|
Symbol::STR_CONCAT => Some(StrConcat),
|
||||||
|
Symbol::STR_JOIN_WITH => Some(StrJoinWith),
|
||||||
|
Symbol::STR_IS_EMPTY => Some(StrIsEmpty),
|
||||||
|
Symbol::STR_STARTS_WITH => Some(StrStartsWith),
|
||||||
|
Symbol::STR_STARTS_WITH_CODE_PT => Some(StrStartsWithCodePt),
|
||||||
|
Symbol::STR_ENDS_WITH => Some(StrEndsWith),
|
||||||
|
Symbol::STR_SPLIT => Some(StrSplit),
|
||||||
|
Symbol::STR_COUNT_GRAPHEMES => Some(StrCountGraphemes),
|
||||||
|
Symbol::STR_FROM_INT => Some(StrFromInt),
|
||||||
|
Symbol::STR_FROM_UTF8 => None,
|
||||||
|
Symbol::STR_FROM_UTF8_RANGE => None,
|
||||||
|
Symbol::STR_TO_UTF8 => Some(StrToUtf8),
|
||||||
|
Symbol::STR_REPEAT => Some(StrRepeat),
|
||||||
|
Symbol::STR_FROM_FLOAT => Some(StrFromFloat),
|
||||||
|
Symbol::STR_TRIM => Some(StrTrim),
|
||||||
|
Symbol::STR_TRIM_LEFT => Some(StrTrimLeft),
|
||||||
|
Symbol::STR_TRIM_RIGHT => Some(StrTrimRight),
|
||||||
|
Symbol::LIST_LEN => Some(ListLen),
|
||||||
|
Symbol::LIST_GET => None,
|
||||||
|
Symbol::LIST_SET => None,
|
||||||
|
Symbol::LIST_SINGLE => Some(ListSingle),
|
||||||
|
Symbol::LIST_REPEAT => Some(ListRepeat),
|
||||||
|
Symbol::LIST_REVERSE => Some(ListReverse),
|
||||||
|
Symbol::LIST_CONCAT => Some(ListConcat),
|
||||||
|
Symbol::LIST_CONTAINS => Some(ListContains),
|
||||||
|
Symbol::LIST_APPEND => Some(ListAppend),
|
||||||
|
Symbol::LIST_PREPEND => Some(ListPrepend),
|
||||||
|
Symbol::LIST_JOIN => Some(ListJoin),
|
||||||
|
Symbol::LIST_RANGE => Some(ListRange),
|
||||||
|
Symbol::LIST_MAP => Some(ListMap),
|
||||||
|
Symbol::LIST_MAP2 => Some(ListMap2),
|
||||||
|
Symbol::LIST_MAP3 => Some(ListMap3),
|
||||||
|
Symbol::LIST_MAP4 => Some(ListMap4),
|
||||||
|
Symbol::LIST_MAP_WITH_INDEX => Some(ListMapWithIndex),
|
||||||
|
Symbol::LIST_KEEP_IF => Some(ListKeepIf),
|
||||||
|
Symbol::LIST_WALK => Some(ListWalk),
|
||||||
|
Symbol::LIST_WALK_UNTIL => Some(ListWalkUntil),
|
||||||
|
Symbol::LIST_WALK_BACKWARDS => Some(ListWalkBackwards),
|
||||||
|
Symbol::LIST_KEEP_OKS => Some(ListKeepOks),
|
||||||
|
Symbol::LIST_KEEP_ERRS => Some(ListKeepErrs),
|
||||||
|
Symbol::LIST_SORT_WITH => Some(ListSortWith),
|
||||||
|
Symbol::LIST_SUBLIST => Some(ListSublist),
|
||||||
|
Symbol::LIST_DROP => Some(ListDrop),
|
||||||
|
Symbol::LIST_DROP_AT => Some(ListDropAt),
|
||||||
|
Symbol::LIST_SWAP => Some(ListSwap),
|
||||||
|
Symbol::LIST_ANY => Some(ListAny),
|
||||||
|
Symbol::LIST_FIND => None,
|
||||||
|
Symbol::DICT_LEN => Some(DictSize),
|
||||||
|
Symbol::DICT_EMPTY => Some(DictEmpty),
|
||||||
|
Symbol::DICT_INSERT => Some(DictInsert),
|
||||||
|
Symbol::DICT_REMOVE => Some(DictRemove),
|
||||||
|
Symbol::DICT_CONTAINS => Some(DictContains),
|
||||||
|
Symbol::DICT_GET => None,
|
||||||
|
Symbol::DICT_KEYS => Some(DictKeys),
|
||||||
|
Symbol::DICT_VALUES => Some(DictValues),
|
||||||
|
Symbol::DICT_UNION => Some(DictUnion),
|
||||||
|
Symbol::DICT_INTERSECTION => Some(DictIntersection),
|
||||||
|
Symbol::DICT_DIFFERENCE => Some(DictDifference),
|
||||||
|
Symbol::DICT_WALK => Some(DictWalk),
|
||||||
|
Symbol::SET_FROM_LIST => Some(SetFromList),
|
||||||
|
Symbol::NUM_ADD => Some(NumAdd),
|
||||||
|
Symbol::NUM_ADD_WRAP => Some(NumAddWrap),
|
||||||
|
Symbol::NUM_ADD_CHECKED => None,
|
||||||
|
Symbol::NUM_SUB => Some(NumSub),
|
||||||
|
Symbol::NUM_SUB_WRAP => Some(NumSubWrap),
|
||||||
|
Symbol::NUM_SUB_CHECKED => None,
|
||||||
|
Symbol::NUM_MUL => Some(NumMul),
|
||||||
|
Symbol::NUM_MUL_WRAP => Some(NumMulWrap),
|
||||||
|
Symbol::NUM_MUL_CHECKED => None,
|
||||||
|
Symbol::NUM_GT => Some(NumGt),
|
||||||
|
Symbol::NUM_GTE => Some(NumGte),
|
||||||
|
Symbol::NUM_LT => Some(NumLt),
|
||||||
|
Symbol::NUM_LTE => Some(NumLte),
|
||||||
|
Symbol::NUM_COMPARE => Some(NumCompare),
|
||||||
|
Symbol::NUM_DIV_FLOAT => None,
|
||||||
|
Symbol::NUM_DIV_CEIL => None,
|
||||||
|
Symbol::NUM_REM => None,
|
||||||
|
Symbol::NUM_IS_MULTIPLE_OF => Some(NumIsMultipleOf),
|
||||||
|
Symbol::NUM_ABS => Some(NumAbs),
|
||||||
|
Symbol::NUM_NEG => Some(NumNeg),
|
||||||
|
Symbol::NUM_SIN => Some(NumSin),
|
||||||
|
Symbol::NUM_COS => Some(NumCos),
|
||||||
|
Symbol::NUM_SQRT => None,
|
||||||
|
Symbol::NUM_LOG => None,
|
||||||
|
Symbol::NUM_ROUND => Some(NumRound),
|
||||||
|
Symbol::NUM_TO_FLOAT => Some(NumToFloat),
|
||||||
|
Symbol::NUM_POW => Some(NumPow),
|
||||||
|
Symbol::NUM_CEILING => Some(NumCeiling),
|
||||||
|
Symbol::NUM_POW_INT => Some(NumPowInt),
|
||||||
|
Symbol::NUM_FLOOR => Some(NumFloor),
|
||||||
|
// => Some(NumIsFinite),
|
||||||
|
Symbol::NUM_ATAN => Some(NumAtan),
|
||||||
|
Symbol::NUM_ACOS => Some(NumAcos),
|
||||||
|
Symbol::NUM_ASIN => Some(NumAsin),
|
||||||
|
Symbol::NUM_BYTES_TO_U16 => None,
|
||||||
|
Symbol::NUM_BYTES_TO_U32 => None,
|
||||||
|
Symbol::NUM_BITWISE_AND => Some(NumBitwiseAnd),
|
||||||
|
Symbol::NUM_BITWISE_XOR => Some(NumBitwiseXor),
|
||||||
|
Symbol::NUM_BITWISE_OR => Some(NumBitwiseOr),
|
||||||
|
Symbol::NUM_SHIFT_LEFT => Some(NumShiftLeftBy),
|
||||||
|
Symbol::NUM_SHIFT_RIGHT => Some(NumShiftRightBy),
|
||||||
|
Symbol::NUM_SHIFT_RIGHT_ZERO_FILL => Some(NumShiftRightZfBy),
|
||||||
|
Symbol::NUM_INT_CAST => Some(NumIntCast),
|
||||||
|
Symbol::BOOL_EQ => Some(Eq),
|
||||||
|
Symbol::BOOL_NEQ => Some(NotEq),
|
||||||
|
Symbol::BOOL_AND => Some(And),
|
||||||
|
Symbol::BOOL_OR => Some(Or),
|
||||||
|
Symbol::BOOL_NOT => Some(Not),
|
||||||
|
// => Some(Hash),
|
||||||
|
// => Some(ExpectTrue),
|
||||||
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue