add Str.countBytes

This commit is contained in:
Folkert 2022-07-03 14:16:47 +02:00
parent 1f943a5452
commit 3cd56c3184
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
9 changed files with 25 additions and 17 deletions

View file

@ -5334,12 +5334,19 @@ fn run_low_level<'a, 'ctx, 'env>(
BasicValueEnum::IntValue(is_zero)
}
StrCountGraphemes => {
// Str.countGraphemes : Str -> Int
// Str.countGraphemes : Str -> Nat
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_bitcode_fn(env, &[string], bitcode::STR_COUNT_GRAPEHEME_CLUSTERS)
}
StrCountBytes => {
// Str.countGraphemes : Str -> Nat
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_bitcode_fn(env, &[string], bitcode::STR_COUNT_BYTES)
}
StrTrim => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);