mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
started on Str.toNum
This commit is contained in:
parent
68e2701948
commit
eaf4e57759
7 changed files with 29 additions and 0 deletions
|
@ -68,6 +68,7 @@ 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,
|
||||
LIST_LEN => list_len,
|
||||
LIST_GET => list_get,
|
||||
LIST_SET => list_set,
|
||||
|
@ -1323,6 +1324,11 @@ fn str_trim_right(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
|||
lowlevel_1(symbol, LowLevel::StrTrimRight, var_store)
|
||||
}
|
||||
|
||||
/// Str.toNum : Str -> Result (Num a) [ ExpectedNum a ]*
|
||||
fn str_to_num(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
lowlevel_1(symbol, LowLevel::StrToNum, var_store)
|
||||
}
|
||||
|
||||
/// Str.repeat : Str, Nat -> Str
|
||||
fn str_repeat(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
let str_var = var_store.fresh();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue