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 "token.h"
#include <stdio.h>
#include <stdlib.h>
#include "../string/string.h"
Token *create_token(TokenType type, int line, int column, char *value) {
Token * token = malloc(sizeof(Token));
@@ -8,6 +9,6 @@ Token *create_token(TokenType type, int line, int column, char *value) {
token->type = type;
token->line=line;
token->column=column;
token->value=value;
token->value=cloneString(value);
return token;
}