aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodes.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-06 07:30:43 -0300
committerBad Diode <bd@badd10de.dev>2022-04-06 07:30:43 -0300
commit77b309ba82d090094f5f753342c3aa401cbf657d (patch)
tree2ead2ad4a87b6ba14c766a62b2a82e7005fb03c1 /src/nodes.h
parentc8b53cb4590d8d6cbfc5cbf891809ddd99e33fe5 (diff)
downloadbdl-77b309ba82d090094f5f753342c3aa401cbf657d.tar.gz
bdl-77b309ba82d090094f5f753342c3aa401cbf657d.zip
Add NODE_BLOCK for scoped expressions
Diffstat (limited to 'src/nodes.h')
-rw-r--r--src/nodes.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nodes.h b/src/nodes.h
index 2e24ea5..c1520b3 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -11,6 +11,7 @@ typedef enum NodeType {
11 NODE_DEF, 11 NODE_DEF,
12 NODE_SET, 12 NODE_SET,
13 NODE_FUN, 13 NODE_FUN,
14 NODE_BLOCK,
14} NodeType; 15} NodeType;
15 16
16typedef struct Node { 17typedef struct Node {
@@ -55,8 +56,13 @@ typedef struct Node {
55 struct Node **param_names; 56 struct Node **param_names;
56 struct Node **param_types; 57 struct Node **param_types;
57 struct Node *return_type; 58 struct Node *return_type;
58 struct Node **body; 59 struct Node *body;
59 } fun; 60 } fun;
61
62 // Block statements.
63 struct {
64 struct Node **expr;
65 } block;
60 }; 66 };
61} Node; 67} Node;
62 68