Merge branch 'lexer' into dev
This commit is contained in:
commit
254a50177f
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue