summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index ff6f17d..8fa5546 100644
--- a/main.c
+++ b/main.c
@@ -6,6 +6,7 @@
#include "identify.h"
#include "check.h"
#include "scope.h"
+#include "memory.h"
#include <stdio.h>
#include <stdlib.h>
@@ -36,6 +37,7 @@ main(int argc, char **argv)
Token *tokens = lexer(slice);
if (tokens != NULL) {
+ Memory memory = {0};
destroy_duplicates(&tokens, TOK_END);
do {
if (group_scope(&tokens) ||
@@ -66,8 +68,13 @@ main(int argc, char **argv)
group->group.type = GROUP_SCOPE;
scope_extract(tokens);
scope_function(tokens);
+ if (memory_create(&memory, tokens)) {
+ fprintf(stderr, "memory_create failed\n");
+ break;
+ }
token_print(tokens, 1, 0);
} while(0);
+ memory_destroy(&memory);
token_destroy(tokens);
}