aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-04-19 13:29:04 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-04-19 13:29:04 -0400
commit3b0dce04a08d864626f841383727fbdab339ec83 (patch)
treec466e7104ff75c76394fd4796cb0752b4f2c6a13 /typecheck.c
parent072bd523b97aacaf8639dd89a49f0c1a16d1d405 (diff)
Add heapify(), heap_push(), and heap_pop()
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index efc105af..bd03588a 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -514,6 +514,9 @@ type_t *get_type(env_t *env, ast_t *ast)
else if (streq(call->name, "clear")) return Type(VoidType);
else if (streq(call->name, "slice")) return self_value_t;
else if (streq(call->name, "reversed")) return self_value_t;
+ else if (streq(call->name, "heapify")) return Type(VoidType);
+ else if (streq(call->name, "heap_push")) return Type(VoidType);
+ else if (streq(call->name, "heap_pop")) return Match(self_value_t, ArrayType)->item_type;
else code_err(ast, "There is no '%s' method for arrays", call->name);
}
case TableType: {