add copying token value and add Boehm GC ready for runtime implimentation

This commit is contained in:
2025-05-29 00:40:11 +01:00
parent b82e351daf
commit 626445a906
7 changed files with 67 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
#include "lexer/lexer.h"
#include "lexer/token.h"
#include "parser/parser.h"
#include "memory.h"
#include <stdbool.h>
#include <stdio.h>
@@ -35,6 +36,7 @@ char* read_file_as_text(const char* filename) {
}
int main() {
ar_memory_init();
const char * path = "test.ar";
char *content = read_file_as_text(path);
@@ -52,12 +54,10 @@ int main() {
LinkedList * parsed = create_list(sizeof(TaggedValue));
parser(parsed, tokens, false);
free_list(tokens);
free(content);
Node *current = parsed->head;
while (current) {
printf("%s\n", (char*)current->data);
printf("%s\n", (char*)((TaggedValue*)current->data)->data);
current = current->next;
}