From bfeb4c6444960439acf96a61cce30265c0480e50 Mon Sep 17 00:00:00 2001 From: Kyler Date: Sat, 29 Nov 2025 13:34:08 -0700 Subject: [PATCH] Removed builtins that won't be done for the assignment --- SLS_C/src/builtin.c | 487 ++++---------------------------------------- 1 file changed, 43 insertions(+), 444 deletions(-) diff --git a/SLS_C/src/builtin.c b/SLS_C/src/builtin.c index 084e1ed..47614c0 100644 --- a/SLS_C/src/builtin.c +++ b/SLS_C/src/builtin.c @@ -27,8 +27,8 @@ Boolean builtin_not_equal_to(InterpreterState *interpreter_state); Boolean builtin_abs(InterpreterState *interpreter_state); Boolean builtin_acos(InterpreterState *interpreter_state); Boolean builtin_asin(InterpreterState *interpreter_state); -Boolean builtin_assert(InterpreterState *interpreter_state); -Boolean builtin_at(InterpreterState *interpreter_state); +// Boolean builtin_assert(InterpreterState *interpreter_state); +// Boolean builtin_at(InterpreterState *interpreter_state); Boolean builtin_atan(InterpreterState *interpreter_state); Boolean builtin_atan2(InterpreterState *interpreter_state); Boolean builtin_bitand(InterpreterState *interpreter_state); @@ -36,71 +36,72 @@ Boolean builtin_bitnot(InterpreterState *interpreter_state); Boolean builtin_bitor(InterpreterState *interpreter_state); Boolean builtin_bitxor(InterpreterState *interpreter_state); Boolean builtin_ceil(InterpreterState *interpreter_state); -Boolean builtin_concat(InterpreterState *interpreter_state); +// Boolean builtin_concat(InterpreterState *interpreter_state); Boolean builtin_cos(InterpreterState *interpreter_state); Boolean builtin_depth(InterpreterState *interpreter_state); Boolean builtin_drop(InterpreterState *interpreter_state); Boolean builtin_dup(InterpreterState *interpreter_state); -Boolean builtin_each(InterpreterState *interpreter_state); -Boolean builtin_ends_with(InterpreterState *interpreter_state); -Boolean builtin_enum(InterpreterState *interpreter_state); -Boolean builtin_enumerate(InterpreterState *interpreter_state); +// Boolean builtin_each(InterpreterState *interpreter_state); +// Boolean builtin_ends_with(InterpreterState *interpreter_state); +// Boolean builtin_enum(InterpreterState *interpreter_state); +// Boolean builtin_enumerate(InterpreterState *interpreter_state); Boolean builtin_eval(InterpreterState *interpreter_state); -Boolean builtin_filter(InterpreterState *interpreter_state); -Boolean builtin_find(InterpreterState *interpreter_state); +// Boolean builtin_filter(InterpreterState *interpreter_state); +// Boolean builtin_find(InterpreterState *interpreter_state); Boolean builtin_floor(InterpreterState *interpreter_state); -Boolean builtin_fn(InterpreterState *interpreter_state); -Boolean builtin_foldl(InterpreterState *interpreter_state); -Boolean builtin_foldr(InterpreterState *interpreter_state); +// Boolean builtin_fn(InterpreterState *interpreter_state); +// Boolean builtin_foldl(InterpreterState *interpreter_state); +// Boolean builtin_foldr(InterpreterState *interpreter_state); Boolean builtin_for(InterpreterState *interpreter_state); -Boolean builtin_format(InterpreterState *interpreter_state); -Boolean builtin_get(InterpreterState *interpreter_state); +// Boolean builtin_format(InterpreterState *interpreter_state); +// Boolean builtin_get(InterpreterState *interpreter_state); Boolean builtin_if(InterpreterState *interpreter_state); -Boolean builtin_impl(InterpreterState *interpreter_state); -Boolean builtin_implements(InterpreterState *interpreter_state); -Boolean builtin_inher(InterpreterState *interpreter_state); +// Boolean builtin_impl(InterpreterState *interpreter_state); +// Boolean builtin_implements(InterpreterState *interpreter_state); +// Boolean builtin_inher(InterpreterState *interpreter_state); Boolean builtin_lambda(InterpreterState *interpreter_state); -Boolean builtin_length(InterpreterState *interpreter_state); +// Boolean builtin_length(InterpreterState *interpreter_state); Boolean builtin_ln(InterpreterState *interpreter_state); Boolean builtin_log(InterpreterState *interpreter_state); Boolean builtin_logb(InterpreterState *interpreter_state); -Boolean builtin_map(InterpreterState *interpreter_state); +// Boolean builtin_map(InterpreterState *interpreter_state); Boolean builtin_match(InterpreterState *interpreter_state); Boolean builtin_max(InterpreterState *interpreter_state); -Boolean builtin_mean(InterpreterState *interpreter_state); +// Boolean builtin_mean(InterpreterState *interpreter_state); Boolean builtin_min(InterpreterState *interpreter_state); Boolean builtin_not(InterpreterState *interpreter_state); Boolean builtin_or(InterpreterState *interpreter_state); -Boolean builtin_over(InterpreterState *interpreter_state); +// Boolean builtin_over(InterpreterState *interpreter_state); Boolean builtin_pick(InterpreterState *interpreter_state); Boolean builtin_rand(InterpreterState *interpreter_state); -Boolean builtin_reduce(InterpreterState *interpreter_state); -Boolean builtin_replace(InterpreterState *interpreter_state); -Boolean builtin_reverse(InterpreterState *interpreter_state); +// Boolean builtin_reduce(InterpreterState *interpreter_state); +// Boolean builtin_replace(InterpreterState *interpreter_state); +// Boolean builtin_reverse(InterpreterState *interpreter_state); Boolean builtin_roll(InterpreterState *interpreter_state); +Boolean builtin_rot(InterpreterState *interpreter_state); Boolean builtin_round(InterpreterState *interpreter_state); Boolean builtin_seed(InterpreterState *interpreter_state); -Boolean builtin_set(InterpreterState *interpreter_state); +// Boolean builtin_set(InterpreterState *interpreter_state); Boolean builtin_shl(InterpreterState *interpreter_state); Boolean builtin_shr(InterpreterState *interpreter_state); Boolean builtin_sin(InterpreterState *interpreter_state); -Boolean builtin_slice(InterpreterState *interpreter_state); -Boolean builtin_split(InterpreterState *interpreter_state); +// Boolean builtin_slice(InterpreterState *interpreter_state); +// Boolean builtin_split(InterpreterState *interpreter_state); Boolean builtin_sqrt(InterpreterState *interpreter_state); -Boolean builtin_starts_with(InterpreterState *interpreter_state); -Boolean builtin_struct(InterpreterState *interpreter_state); -Boolean builtin_substr(InterpreterState *interpreter_state); -Boolean builtin_sum(InterpreterState *interpreter_state); +// Boolean builtin_starts_with(InterpreterState *interpreter_state); +// Boolean builtin_struct(InterpreterState *interpreter_state); +// Boolean builtin_substr(InterpreterState *interpreter_state); +// Boolean builtin_sum(InterpreterState *interpreter_state); Boolean builtin_swap(InterpreterState *interpreter_state); Boolean builtin_tan(InterpreterState *interpreter_state); -Boolean builtin_trait(InterpreterState *interpreter_state); -Boolean builtin_transpose(InterpreterState *interpreter_state); -Boolean builtin_trim(InterpreterState *interpreter_state); +// Boolean builtin_trait(InterpreterState *interpreter_state); +// Boolean builtin_transpose(InterpreterState *interpreter_state); +// Boolean builtin_trim(InterpreterState *interpreter_state); Boolean builtin_type_of(InterpreterState *interpreter_state); -Boolean builtin_union(InterpreterState *interpreter_state); +// Boolean builtin_union(InterpreterState *interpreter_state); Boolean builtin_while(InterpreterState *interpreter_state); -Boolean builtin_window(InterpreterState *interpreter_state); -Boolean builtin_zip(InterpreterState *interpreter_state); +// Boolean builtin_window(InterpreterState *interpreter_state); +// Boolean builtin_zip(InterpreterState *interpreter_state); static inline Boolean hash_table_put_funcs(HashTable *ht, SlsStr key, FunctionItem *item) { return hash_table_put(ht, key, (void *)item); @@ -209,18 +210,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("asin"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_assert}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("assert"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_at}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("at"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_atan}; @@ -263,12 +252,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("ceil"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_concat}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("concat"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_cos}; @@ -293,126 +276,36 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("dup"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_each}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("each"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_ends_with}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("ends_with"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_enum}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("enum"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_enumerate}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("enumerate"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_eval}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("eval"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_filter}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("filter"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_find}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("find"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_floor}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("floor"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_fn}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("fn"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_foldl}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("foldl"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_foldr}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("foldr"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_for}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("for"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_format}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("format"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_get}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("get"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_if}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("if"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_impl}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("impl"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_implements}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("implements"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_inher}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("inher"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_lambda}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("lambda"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_length}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("length"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_ln}; @@ -431,12 +324,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("logb"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_map}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("map"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_match}; @@ -449,12 +336,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("max"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_mean}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("mean"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_min}; @@ -473,12 +354,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("or"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_over}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("over"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_pick}; @@ -491,24 +366,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("rand"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_reduce}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("reduce"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_replace}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("replace"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_reverse}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("reverse"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_roll}; @@ -527,12 +384,6 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("seed"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_set}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("set"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_shl}; @@ -551,48 +402,12 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("sin"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_slice}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("slice"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_split}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("split"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_sqrt}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("sqrt"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_starts_with}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("starts_with"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_struct}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("struct"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_substr}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("substr"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_sum}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("sum"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_swap}; @@ -605,54 +420,18 @@ Boolean load_builtins(InterpreterState *interpreter_state) { if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("tan"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_trait}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("trait"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_transpose}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("transpose"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_trim}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("trim"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_type_of}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("type_of"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_union}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("union"), func)) - return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); if (func == NULL) return FALSE; *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_while}; if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("while"), func)) return FALSE; - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_window}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("window"), func)) - return FALSE; - - func = (FunctionItem *)malloc(sizeof(FunctionItem)); - if (func == NULL) return FALSE; - *func = (FunctionItem){ .type = FUNCTION_BUILTIN, .builtin = *builtin_zip}; - if (!hash_table_put_funcs(interpreter_state->functions, SLS_STR("zip"), func)) - return FALSE; - return TRUE; } @@ -1062,16 +841,6 @@ Boolean builtin_asin(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_assert(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_at(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_atan(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1107,11 +876,6 @@ Boolean builtin_ceil(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_concat(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_cos(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1144,106 +908,31 @@ Boolean builtin_dup(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_each(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_ends_with(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_enum(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_enumerate(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_eval(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_filter(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_find(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_floor(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_fn(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_foldl(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_foldr(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_for(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_format(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_get(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_if(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_impl(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_implements(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_inher(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_lambda(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_length(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_ln(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1259,11 +948,6 @@ Boolean builtin_logb(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_map(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_match(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1274,11 +958,6 @@ Boolean builtin_max(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_mean(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_min(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1294,11 +973,6 @@ Boolean builtin_or(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_over(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_pick(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1309,26 +983,16 @@ Boolean builtin_rand(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_reduce(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_replace(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_reverse(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_roll(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } +Boolean builtin_rot(InterpreterState *interpreter_state) { + (void)interpreter_state; + return FALSE; +} + Boolean builtin_round(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1339,11 +1003,6 @@ Boolean builtin_seed(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_set(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_shl(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1359,41 +1018,11 @@ Boolean builtin_sin(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_slice(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_split(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_sqrt(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_starts_with(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_struct(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_substr(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_sum(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_swap(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; @@ -1404,42 +1033,12 @@ Boolean builtin_tan(InterpreterState *interpreter_state) { return FALSE; } -Boolean builtin_trait(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_transpose(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_trim(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_type_of(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } -Boolean builtin_union(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - Boolean builtin_while(InterpreterState *interpreter_state) { (void)interpreter_state; return FALSE; } - -Boolean builtin_window(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -} - -Boolean builtin_zip(InterpreterState *interpreter_state) { - (void)interpreter_state; - return FALSE; -}