aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodes.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-08 18:49:40 -0300
committerBad Diode <bd@badd10de.dev>2022-04-08 18:49:40 -0300
commit233dd92768a54060df9096558aa58c1f598cce7d (patch)
tree70cad899ab9767e6cc069192a763e2c0354b9f3f /src/nodes.h
parent55ecfb3b7713172f76ddbff022fa4d6a80d0661a (diff)
downloadbdl-233dd92768a54060df9096558aa58c1f598cce7d.tar.gz
bdl-233dd92768a54060df9096558aa58c1f598cce7d.zip
Add rudimentary type checking
Diffstat (limited to 'src/nodes.h')
-rw-r--r--src/nodes.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/nodes.h b/src/nodes.h
index be6f7df..52022cc 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -15,21 +15,13 @@ typedef enum NodeType {
15 NODE_IF, 15 NODE_IF,
16} NodeType; 16} NodeType;
17 17
18typedef enum TypeClass {
19 TYPE_UNK,
20 TYPE_NONE,
21 TYPE_NUM,
22 TYPE_BOOL,
23 TYPE_STRING,
24} TypeClass;
25
26typedef struct Node { 18typedef struct Node {
27 size_t id; 19 size_t id;
28 NodeType type; 20 NodeType type;
29 size_t line; 21 size_t line;
30 size_t col; 22 size_t col;
31 struct Scope *scope; 23 struct Scope *scope;
32 TypeClass type_class; 24 struct Type *expr_type;
33 25
34 union { 26 union {
35 // Numbers. 27 // Numbers.