mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
add substringUnsafe roc function
This commit is contained in:
parent
45eb8b9d77
commit
be3800d7fa
9 changed files with 29 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue