feat: switch to using a builtin per num type to convert from a string

This commit is contained in:
rvcas 2021-12-06 22:24:00 -05:00
parent bc5b1abcba
commit e587e20de2
6 changed files with 122 additions and 25 deletions

View file

@ -68,7 +68,11 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
STR_TRIM => str_trim,
STR_TRIM_LEFT => str_trim_left,
STR_TRIM_RIGHT => str_trim_right,
STR_TO_NUM => str_to_num,
STR_TO_DEC => str_to_num,
STR_TO_F64 => str_to_num,
STR_TO_F32 => str_to_num,
STR_TO_NAT => str_to_num,
STR_TO_U64 => str_to_num,
LIST_LEN => list_len,
LIST_GET => list_get,
LIST_SET => list_set,