initial commit of Str.trimLeft

This commit is contained in:
Michael Downey 2021-11-09 14:25:24 -05:00
parent 35df58c18f
commit 1bc278d962
13 changed files with 159 additions and 7 deletions

View file

@ -68,6 +68,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
STR_FROM_FLOAT=> str_from_float,
STR_REPEAT => str_repeat,
STR_TRIM => str_trim,
STR_TRIM_LEFT => str_trim_left,
LIST_LEN => list_len,
LIST_GET => list_get,
LIST_SET => list_set,
@ -1284,6 +1285,10 @@ fn str_trim(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_1(symbol, LowLevel::StrTrim, var_store)
}
fn str_trim_left(symbol: Symbol, var_store: &mut VarStore) -> Def {
lowlevel_1(symbol, LowLevel::StrTrimLeft, var_store)
}
/// Str.repeat : Str, Nat -> Str
fn str_repeat(symbol: Symbol, var_store: &mut VarStore) -> Def {
let str_var = var_store.fresh();