update lexer to just return the number and then do the other logic somewhere else
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
#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));
|
||||
printf("%s\n", value);
|
||||
token->type = type;
|
||||
token->line=line;
|
||||
token->column=column;
|
||||
token->value=cloneString(value);
|
||||
return token;
|
||||
}
|
||||
|
||||
void free_token(void * ptr) {
|
||||
Token* token = ptr;
|
||||
free(token->value);
|
||||
}
|
||||
Reference in New Issue
Block a user