mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
feat: switch to using a builtin per num type to convert from a string
This commit is contained in:
parent
bc5b1abcba
commit
e587e20de2
6 changed files with 122 additions and 25 deletions
|
@ -195,7 +195,11 @@ impl LowLevel {
|
|||
Symbol::STR_TRIM => Some(StrTrim),
|
||||
Symbol::STR_TRIM_LEFT => Some(StrTrimLeft),
|
||||
Symbol::STR_TRIM_RIGHT => Some(StrTrimRight),
|
||||
Symbol::STR_TO_NUM => Some(StrToNum),
|
||||
Symbol::STR_TO_DEC => Some(StrToNum),
|
||||
Symbol::STR_TO_F64 => Some(StrToNum),
|
||||
Symbol::STR_TO_F32 => Some(StrToNum),
|
||||
Symbol::STR_TO_NAT => Some(StrToNum),
|
||||
Symbol::STR_TO_U64 => Some(StrToNum),
|
||||
Symbol::LIST_LEN => Some(ListLen),
|
||||
Symbol::LIST_GET => None,
|
||||
Symbol::LIST_SET => None,
|
||||
|
|
|
@ -1029,7 +1029,12 @@ define_builtins! {
|
|||
18 STR_TRIM: "trim"
|
||||
19 STR_TRIM_LEFT: "trimLeft"
|
||||
20 STR_TRIM_RIGHT: "trimRight"
|
||||
21 STR_TO_NUM: "toNum"
|
||||
21 STR_TO_DEC: "toDec"
|
||||
22 STR_TO_F64: "toF64"
|
||||
23 STR_TO_F32: "toF32"
|
||||
24 STR_TO_NAT: "toNat"
|
||||
25 STR_TO_U64: "toU64"
|
||||
|
||||
}
|
||||
4 LIST: "List" => {
|
||||
0 LIST_LIST: "List" imported // the List.List type alias
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue