implemented Str.trimRight

This commit is contained in:
Theo Felippe 2021-11-13 18:02:58 +00:00
parent f92a1f83e3
commit 8d7c252fce
12 changed files with 237 additions and 1 deletions

View file

@ -269,6 +269,16 @@ pub fn str_trim_left<'a, 'ctx, 'env>(
call_bitcode_fn(env, &[str_i128.into()], bitcode::STR_TRIM_LEFT)
}
/// Str.trimRight : Str -> Str
pub fn str_trim_right<'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_RIGHT)
}
/// Str.fromInt : Int -> Str
pub fn str_from_int<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,