added pointer types resolution, type validity checks and void type

This commit is contained in:
Lorenzo Torres 2025-12-05 16:45:03 +01:00
parent 8f19852746
commit 3ca2c2f009
5 changed files with 51 additions and 14 deletions

17
sema.h
View file

@ -9,13 +9,14 @@
typedef enum {
TYPE_VOID,
TYPE_PTR,
TYPE_SLICE,
TYPE_FLOAT,
TYPE_INTEGER,
TYPE_UINTEGER,
TYPE_STRUCT,
TYPE_UNION,
TYPE_ENUM,
TYPE_GENERIC,
TYPE_ENUM, /* TODO */
TYPE_GENERIC, /* TODO */
} type_tag;
typedef struct _type {
@ -33,8 +34,10 @@ typedef struct _type {
} ptr;
struct {
usize len;
bool is_const;
bool is_volatile;
struct _type *child;
} array;
} slice;
struct {
char *name;
usize name_len;
@ -44,10 +47,16 @@ typedef struct _type {
char *name;
usize name_len;
variant *variants;
} enm;
} enm; /* TODO */
} data;
} type;
typedef struct {
char *name;
type *type;
type *parameters
} prototype;
typedef struct {
arena *allocator;
ast_node *ast;