almost finished implementing sema

This commit is contained in:
Lorenzo Torres 2025-12-05 23:27:22 +01:00
parent 8b4b81e90b
commit 463ba71843
8 changed files with 380 additions and 43 deletions

7
sema.h
View file

@ -8,6 +8,7 @@
typedef enum {
TYPE_VOID,
TYPE_BOOL,
TYPE_PTR,
TYPE_SLICE,
TYPE_FLOAT,
@ -42,6 +43,7 @@ typedef struct _type {
char *name;
usize name_len;
member *members;
struct { char *key; struct _type *value; } *member_types;
} structure;
struct {
char *name;
@ -57,6 +59,11 @@ typedef struct {
type **parameters;
} prototype;
typedef struct _scope {
struct _scope *parent;
struct { char *key; type *value; } *defs;
} scope;
typedef struct {
arena *allocator;
ast_node *ast;