aboutsummaryrefslogtreecommitdiff
path: root/src/typecheck.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-21 21:43:51 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-21 21:43:51 -0400
commitdcf266228512e100e779fe72f2d4e9ebb605ffe6 (patch)
tree6fb3cac1ee3647f08bca219949ed8dc61b5861f2 /src/typecheck.h
parent9acea1807f5945c55445a16259386e4979203a1e (diff)
Move files into src/ and build into build/
Diffstat (limited to 'src/typecheck.h')
-rw-r--r--src/typecheck.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/typecheck.h b/src/typecheck.h
new file mode 100644
index 00000000..cc5cb18c
--- /dev/null
+++ b/src/typecheck.h
@@ -0,0 +1,33 @@
+#pragma once
+
+// Type-checking functions
+
+#include <gc.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "ast.h"
+#include "environment.h"
+#include "stdlib/datatypes.h"
+#include "types.h"
+
+type_t *parse_type_ast(env_t *env, type_ast_t *ast);
+type_t *get_type(env_t *env, ast_t *ast);
+void prebind_statement(env_t *env, ast_t *statement);
+void bind_statement(env_t *env, ast_t *statement);
+PUREFUNC type_t *get_math_type(env_t *env, ast_t *ast, type_t *lhs_t, type_t *rhs_t);
+PUREFUNC bool is_discardable(env_t *env, ast_t *ast);
+type_t *get_function_def_type(env_t *env, ast_t *ast);
+type_t *get_arg_type(env_t *env, arg_t *arg);
+type_t *get_arg_ast_type(env_t *env, arg_ast_t *arg);
+env_t *when_clause_scope(env_t *env, type_t *subject_t, when_clause_t *clause);
+type_t *get_clause_type(env_t *env, type_t *subject_t, when_clause_t *clause);
+PUREFUNC bool can_be_mutated(env_t *env, ast_t *ast);
+type_t *parse_type_string(env_t *env, const char *str);
+type_t *get_method_type(env_t *env, ast_t *self, const char *name);
+PUREFUNC bool is_constant(env_t *env, ast_t *ast);
+Table_t *get_arg_bindings(env_t *env, arg_t *spec_args, arg_ast_t *call_args, bool promotion_allowed);
+bool is_valid_call(env_t *env, arg_t *spec_args, arg_ast_t *call_args, bool promotion_allowed);
+
+// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0