diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-15 02:17:53 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-15 02:17:53 -0400 |
| commit | ed1667cb377dd8da51583e703c6677969addc993 (patch) | |
| tree | 531424aa9647ef49549000bb145e2b798c868154 /compile.c | |
| parent | 7a472752e5be47816f756d854a1b0756594fef98 (diff) | |
Add array:shuffled() and checks for array insertion
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2122,6 +2122,10 @@ CORD compile(env_t *env, ast_t *ast) CORD self = compile_to_pointer_depth(env, call->self, 1, false); (void)compile_arguments(env, ast, NULL, call->args); return CORD_all("Array$shuffle(", self, ", ", padded_item_size, ")"); + } else if (streq(call->name, "shuffled")) { + CORD self = compile_to_pointer_depth(env, call->self, 0, false); + (void)compile_arguments(env, ast, NULL, call->args); + return CORD_all("Array$shuffled(", self, ", ", padded_item_size, ")"); } else if (streq(call->name, "sort") || streq(call->name, "sorted")) { CORD self = compile_to_pointer_depth(env, call->self, streq(call->name, "sort") ? 1 : 0, false); CORD comparison; |
