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

@ -259,6 +259,16 @@ pub fn str_trim<'a, 'ctx, 'env>(
call_bitcode_fn(env, &[str_i128.into()], bitcode::STR_TRIM)
}
/// Str.trim : Str -> Str
pub fn str_trim_left<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
scope: &Scope<'a, 'ctx>,
str_symbol: Symbol,
) -> BasicValueEnum<'ctx> {
let str_i128 = str_symbol_to_c_abi(env, scope, str_symbol);
call_bitcode_fn(env, &[str_i128.into()], bitcode::STR_TRIM_LEFT)
}
/// Str.fromInt : Int -> Str
pub fn str_from_int<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,