aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodes.h')
-rw-r--r--src/nodes.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nodes.h b/src/nodes.h
index 566d6d3..2e24ea5 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -7,8 +7,10 @@ typedef enum NodeType {
7 NODE_BOOL, 7 NODE_BOOL,
8 NODE_STRING, 8 NODE_STRING,
9 NODE_SYMBOL, 9 NODE_SYMBOL,
10 NODE_TYPE,
10 NODE_DEF, 11 NODE_DEF,
11 NODE_SET, 12 NODE_SET,
13 NODE_FUN,
12} NodeType; 14} NodeType;
13 15
14typedef struct Node { 16typedef struct Node {
@@ -38,13 +40,23 @@ typedef struct Node {
38 struct { 40 struct {
39 struct Node *symbol; 41 struct Node *symbol;
40 struct Node *value; 42 struct Node *value;
41 StringView type; 43 struct Node *type;
42 } def; 44 } def;
43 45
46 // Variable assignment.
44 struct { 47 struct {
45 struct Node *symbol; 48 struct Node *symbol;
46 struct Node *value; 49 struct Node *value;
47 } set; 50 } set;
51
52 // Function definition.
53 struct {
54 struct Node *name;
55 struct Node **param_names;
56 struct Node **param_types;
57 struct Node *return_type;
58 struct Node **body;
59 } fun;
48 }; 60 };
49} Node; 61} Node;
50 62