initial commit of Str.trimLeft

This commit is contained in:
Michael Downey 2021-11-09 14:25:24 -05:00
parent 35df58c18f
commit 1bc278d962
13 changed files with 159 additions and 7 deletions

View file

@ -14,11 +14,7 @@ use crate::llvm::build_list::{
list_map_with_index, list_prepend, list_range, list_repeat, list_reverse, list_set,
list_single, list_sort_with, list_swap, list_take_first,
};
use crate::llvm::build_str::{
empty_str, str_concat, str_count_graphemes, str_ends_with, str_from_float, str_from_int,
str_from_utf8, str_from_utf8_range, str_join_with, str_number_of_bytes, str_repeat, str_split,
str_starts_with, str_starts_with_code_point, str_to_utf8, str_trim,
};
use crate::llvm::build_str::{empty_str, str_concat, str_count_graphemes, str_ends_with, str_from_float, str_from_int, str_from_utf8, str_from_utf8_range, str_join_with, str_number_of_bytes, str_repeat, str_split, str_starts_with, str_starts_with_code_point, str_to_utf8, str_trim, str_trim_left};
use crate::llvm::compare::{generic_eq, generic_neq};
use crate::llvm::convert::{
basic_type_from_builtin, basic_type_from_layout, block_of_memory_slices, ptr_int,
@ -5054,6 +5050,12 @@ fn run_low_level<'a, 'ctx, 'env>(
str_trim(env, scope, args[0])
}
StrTrimLeft => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);
str_trim_left(env, scope, args[0])
}
ListLen => {
// List.len : List * -> Int
debug_assert_eq!(args.len(), 1);