feat(lexer): elif token type

This commit is contained in:
Matteo Flebus 2026-01-14 19:58:59 +01:00
parent 254a50177f
commit bc7f8f3e8c
2 changed files with 6 additions and 1 deletions

View file

@ -82,6 +82,10 @@ static void set_token_keyword(struct token *tok, char *begin, ssize_t size)
{
tok->type = TOKEN_ELSE;
}
else if (strncmp(begin, "elif", size) == 0)
{
tok->type = TOKEN_ELIF;
}
tok->data = calloc(size + 1, sizeof(char));
if (tok->data == NULL)

View file

@ -14,7 +14,8 @@ enum token_type
TOKEN_IF,
TOKEN_THEN,
TOKEN_ELSE,
TOKEN_FI
TOKEN_FI,
TOKEN_ELIF
};
struct token