aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodes.c')
-rw-r--r--src/nodes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nodes.c b/src/nodes.c
index 5689d18..35d123a 100644
--- a/src/nodes.c
+++ b/src/nodes.c
@@ -1,10 +1,13 @@
1#include "nodes.h" 1#include "nodes.h"
2 2
3static size_t node_gen_id = 0;
4
3Node * 5Node *
4alloc_node(NodeType type) { 6alloc_node(NodeType type) {
5 // TODO: Use a bump allocator? 7 // TODO: Use a bump allocator?
6 // TODO: Free memory! 8 // TODO: Free memory!
7 Node *node = malloc(sizeof(Node)); 9 Node *node = malloc(sizeof(Node));
10 node->id = node_gen_id++;
8 node->type = type; 11 node->type = type;
9 node->line = 0; 12 node->line = 0;
10 node->col = 0; 13 node->col = 0;