mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
add Str.endsWith
This commit is contained in:
parent
e8583a72fb
commit
22d798b7c7
12 changed files with 121 additions and 15 deletions
|
@ -4,7 +4,8 @@ use crate::llvm::build_list::{
|
|||
list_reverse, list_set, list_single, list_sum, list_walk, list_walk_backwards,
|
||||
};
|
||||
use crate::llvm::build_str::{
|
||||
str_concat, str_count_graphemes, str_len, str_split, str_starts_with, CHAR_LAYOUT,
|
||||
str_concat, str_count_graphemes, str_ends_with, str_len, str_split, str_starts_with,
|
||||
CHAR_LAYOUT,
|
||||
};
|
||||
use crate::llvm::compare::{build_eq, build_neq};
|
||||
use crate::llvm::convert::{
|
||||
|
@ -2436,6 +2437,14 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
str_starts_with(env, inplace, scope, parent, args[0], args[1])
|
||||
}
|
||||
StrEndsWith => {
|
||||
// Str.startsWith : Str, Str -> Bool
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let inplace = get_inplace_from_layout(layout);
|
||||
|
||||
str_ends_with(env, inplace, scope, parent, args[0], args[1])
|
||||
}
|
||||
StrSplit => {
|
||||
// Str.split : Str, Str -> List Str
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue