aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-18 23:24:23 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-18 23:24:23 -0400
commit2e8c949fdcf56d6055ed8b78a825d9061ab0ceb4 (patch)
treef3644759f7045185b110f3d81d18067b55feab49 /compile.c
parentb76fbd3beba08c098c6d18578230f9edbc4d3a3d (diff)
Rename push/pop to give/get, since it's not stack-ordered
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/compile.c b/compile.c
index 748f5541..08b56938 100644
--- a/compile.c
+++ b/compile.c
@@ -2363,20 +2363,20 @@ CORD compile(env_t *env, ast_t *ast)
case ChannelType: {
type_t *item_t = Match(self_value_t, ChannelType)->item_type;
CORD padded_item_size = CORD_asprintf("%ld", padded_type_size(item_t));
- if (streq(call->name, "push")) {
+ if (streq(call->name, "give")) {
CORD self = compile_to_pointer_depth(env, call->self, 0, false);
arg_t *arg_spec = new(arg_t, .name="item", .type=item_t);
- return CORD_all("Channel$push_value(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ",
+ return CORD_all("Channel$give_value(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ",
padded_item_size, ")");
- } else if (streq(call->name, "push_all")) {
+ } else if (streq(call->name, "give_all")) {
CORD self = compile_to_pointer_depth(env, call->self, 0, false);
- arg_t *arg_spec = new(arg_t, .name="to_push", .type=Type(ArrayType, .item_type=item_t));
- return CORD_all("Channel$push_all(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ",
+ arg_t *arg_spec = new(arg_t, .name="to_give", .type=Type(ArrayType, .item_type=item_t));
+ return CORD_all("Channel$give_all(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ",
padded_item_size, ")");
- } else if (streq(call->name, "pop")) {
+ } else if (streq(call->name, "get")) {
CORD self = compile_to_pointer_depth(env, call->self, 0, false);
(void)compile_arguments(env, ast, NULL, call->args);
- return CORD_all("Channel$pop_value(", self, ", ", compile_type(item_t), ", ", padded_item_size, ")");
+ return CORD_all("Channel$get_value(", self, ", ", compile_type(item_t), ", ", padded_item_size, ")");
} else if (streq(call->name, "clear")) {
CORD self = compile_to_pointer_depth(env, call->self, 0, false);
(void)compile_arguments(env, ast, NULL, call->args);