aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodes.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-06 08:02:52 -0300
committerBad Diode <bd@badd10de.dev>2022-04-06 08:02:52 -0300
commit11df0f4556f526189234be216fa16a2fcb8c308b (patch)
treed9459ebf0b99ef1ecadf4101da147d60935e916f /src/nodes.h
parent77b309ba82d090094f5f753342c3aa401cbf657d (diff)
downloadbdl-11df0f4556f526189234be216fa16a2fcb8c308b.tar.gz
bdl-11df0f4556f526189234be216fa16a2fcb8c308b.zip
Add parsing of if statements
Diffstat (limited to 'src/nodes.h')
-rw-r--r--src/nodes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nodes.h b/src/nodes.h
index c1520b3..4fb48a1 100644
--- a/src/nodes.h
+++ b/src/nodes.h
@@ -12,6 +12,7 @@ typedef enum NodeType {
12 NODE_SET, 12 NODE_SET,
13 NODE_FUN, 13 NODE_FUN,
14 NODE_BLOCK, 14 NODE_BLOCK,
15 NODE_IF,
15} NodeType; 16} NodeType;
16 17
17typedef struct Node { 18typedef struct Node {
@@ -63,6 +64,13 @@ typedef struct Node {
63 struct { 64 struct {
64 struct Node **expr; 65 struct Node **expr;
65 } block; 66 } block;
67
68 // If statement.
69 struct {
70 struct Node *cond;
71 struct Node *expr_true;
72 struct Node *expr_false;
73 } ifexpr;
66 }; 74 };
67} Node; 75} Node;
68 76