aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-18 00:30:55 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-18 00:30:55 -0400
commitfead0cad826488a76fb68c0ab2efcb2d76b9f542 (patch)
tree0d028781eaa9e1c556c525d0bc6709f829ad3e2f /typecheck.c
parentec88848f6b5c9053932a41a10e45200b3f1b9650 (diff)
Remove dead code
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/typecheck.c b/typecheck.c
index 98fb910e..576007a3 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -1295,39 +1295,6 @@ PUREFUNC bool is_discardable(env_t *env, ast_t *ast)
return (t->tag == VoidType || t->tag == AbortType || t->tag == ReturnType);
}
-type_t *get_file_type(env_t *env, const char *path)
-{
- ast_t *ast = parse_file(path, NULL);
- if (!ast) compiler_err(NULL, NULL, NULL, "Couldn't parse file: %s", path);
-
- arg_t *ns_fields = NULL;
- for (ast_list_t *stmts = Match(ast, Block)->statements; stmts; stmts = stmts->next) {
- ast_t *stmt = stmts->ast;
- doctest_inner:
- switch (stmt->tag) {
- case Declare: {
- auto decl = Match(stmt, Declare);
- const char *name = Match(decl->var, Var)->name;
- type_t *t = get_type(env, decl->value);
- ns_fields = new(arg_t, .name=name, .type=t, .next=ns_fields);
- break;
- }
- case FunctionDef: {
- type_t *t = get_function_def_type(env, stmt);
- const char *name = Match(Match(stmt, FunctionDef)->name, Var)->name;
- ns_fields = new(arg_t, .name=name, .type=t, .next=ns_fields);
- break;
- }
- case DocTest: {
- stmt = Match(stmt, DocTest)->expr;
- goto doctest_inner;
- }
- default: break;
- }
- }
- return Type(StructType, .name=path, .fields=ns_fields);
-}
-
type_t *get_arg_ast_type(env_t *env, arg_ast_t *arg)
{
assert(arg->type || arg->value);