From 424be65858999a894a18e1972fa9649fbc4c1df8 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Fri, 17 Jul 2026 12:40:59 -0700 Subject: improve type system sorta --- ast.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index a2d576b..1eda481 100644 --- a/ast.h +++ b/ast.h @@ -6,12 +6,9 @@ struct stmt_node; struct expr_node; -struct type_node { - bool is_unsigned; - bool is_short; - bool is_long; +struct type_ref_node { unsigned char ptr_level; - struct type_def* def; + const struct type_def* def_ref; }; struct int_lit_node { @@ -35,8 +32,8 @@ struct var_ref_node { }; struct var_decl_node { - struct type_node type; - char* ident; + struct type_ref_node type; + struct var_def* def_ref; }; struct lval_node { @@ -108,10 +105,7 @@ struct expr_node { struct binary_node binary; } inner; - struct { - bool is_signed; - unsigned long long sz; - } evaluated_type; + const struct type_def* resolved_type; }; struct group_node { @@ -125,7 +119,7 @@ struct args_decl_node { }; struct fn_decl_node { - struct type_node return_type; + struct type_ref_node return_type; char* name; struct args_decl_node* args; struct group_node body; -- cgit v1.2.3