From b48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Thu, 6 Aug 2026 00:24:49 -0400 Subject: clean up yesterday's hacks + functions in type system --- ast.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index af35d45..0c5c741 100644 --- a/ast.h +++ b/ast.h @@ -31,7 +31,7 @@ struct str_lit_node { }; struct var_ref_node { - struct var_def* def_ref; + const struct var_def* def_ref; }; struct decl_node { @@ -51,8 +51,7 @@ struct assign_node { }; struct call_node { - /* TODO: function pointers */ - struct fn_decl_node* fn_ref; /* borrowed */ + struct expr_node* expr; struct expr_list_node* args; }; @@ -126,15 +125,15 @@ struct arg_decl_node { }; struct fn_decl_node { - struct type return_type; - const char* name; + struct type type; + char* name; /* TODO: why is this borrowed? who owns it? */ struct arg_decl_node* args; struct group_node* body; struct scope* scope; }; struct return_node { - struct fn_decl_node* fn_ref; + struct var_def* fn_def; struct expr_list_node* ret_val; /* null to return void */ }; -- cgit v1.2.3