diff options
author | Bad Diode <bd@badd10de.dev> | 2022-04-08 18:49:40 -0300 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2022-04-08 18:49:40 -0300 |
commit | 233dd92768a54060df9096558aa58c1f598cce7d (patch) | |
tree | 70cad899ab9767e6cc069192a763e2c0354b9f3f /src/parser.h | |
parent | 55ecfb3b7713172f76ddbff022fa4d6a80d0661a (diff) | |
download | bdl-233dd92768a54060df9096558aa58c1f598cce7d.tar.gz bdl-233dd92768a54060df9096558aa58c1f598cce7d.zip |
Add rudimentary type checking
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser.h b/src/parser.h index 3c2dc2b..cc3ba92 100644 --- a/src/parser.h +++ b/src/parser.h | |||
@@ -5,10 +5,15 @@ | |||
5 | #include "nodes.h" | 5 | #include "nodes.h" |
6 | #include "hashtable.h" | 6 | #include "hashtable.h" |
7 | 7 | ||
8 | typedef struct Type { | ||
9 | StringView name; | ||
10 | size_t size; // (bytes) | ||
11 | } Type; | ||
12 | |||
8 | typedef struct Scope { | 13 | typedef struct Scope { |
9 | struct Scope *parent; | 14 | struct Scope *parent; |
10 | HashTable *symbols; | 15 | HashTable *symbols; |
11 | // HashTable types; | 16 | HashTable *types; |
12 | } Scope; | 17 | } Scope; |
13 | 18 | ||
14 | typedef struct ParseTree { | 19 | typedef struct ParseTree { |