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 --- type.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'type.h') diff --git a/type.h b/type.h index ef848c5..a67fabb 100644 --- a/type.h +++ b/type.h @@ -9,10 +9,16 @@ struct data_type { bool is_floating; }; +struct fn_type { + struct type_list* arg_types; + struct type* return_type; +}; + struct type { enum { TP_DATA, TP_PTR, + TP_FN, } type; union { struct { @@ -23,9 +29,15 @@ struct type { const struct data_type* data_type; integral_t ptr_level; } pointer; + struct fn_type fn; }; }; +struct type_list { + const struct type* type; + struct type_list* next; +}; + extern const struct data_type void_type; extern const struct data_type char_type; extern const struct data_type short_type; -- cgit v1.2.3