Merge branch 'lexer' into dev

This commit is contained in:
Matteo Flebus 2026-01-14 18:48:43 +01:00
commit 254a50177f

View file

@ -82,6 +82,11 @@ static void set_token_keyword(struct token *tok, char *begin, ssize_t size)
{ {
tok->type = TOKEN_ELSE; tok->type = TOKEN_ELSE;
} }
tok->data = calloc(size + 1, sizeof(char));
if (tok->data == NULL)
return;
strncpy(tok->data, begin, size);
} }
/* @brief: if token_type has not yet been set, then it is a TOKEN_WORD /* @brief: if token_type has not yet been set, then it is a TOKEN_WORD