add substringUnsafe roc function

This commit is contained in:
Folkert 2022-07-03 17:15:25 +02:00
parent 45eb8b9d77
commit be3800d7fa
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
9 changed files with 29 additions and 0 deletions

View file

@ -5347,6 +5347,15 @@ fn run_low_level<'a, 'ctx, 'env>(
let string = load_symbol(scope, &args[0]);
call_bitcode_fn(env, &[string], bitcode::STR_COUNT_BYTES)
}
StrSubstringUnsafe => {
// Str.substringUnsafe : Str, Nat, Nat -> Str
debug_assert_eq!(args.len(), 3);
let string = load_symbol(scope, &args[0]);
let start = load_symbol(scope, &args[1]);
let length = load_symbol(scope, &args[2]);
call_str_bitcode_fn(env, &[string, start, length], bitcode::STR_SUBSTRING_UNSAFE)
}
StrTrim => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);