feat(lexer + parser): export handling
This commit is contained in:
parent
bada9c6a29
commit
115377edfe
3 changed files with 80 additions and 50 deletions
|
|
@ -72,6 +72,8 @@ static void set_token_keyword(struct token *tok, char *begin, ssize_t size)
|
|||
tok->type = TOKEN_ELSE;
|
||||
else if (strncmp(begin, "elif", size) == 0 && size == 4)
|
||||
tok->type = TOKEN_ELIF;
|
||||
else if (strncmp(begin, "export", size) == 0 && size == 6)
|
||||
tok->type = TOKEN_ELIF;
|
||||
|
||||
// no keywords found.
|
||||
if (tok->type == TOKEN_NULL)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ enum token_type
|
|||
TOKEN_FOR,
|
||||
TOKEN_WHILE,
|
||||
TOKEN_UNTIL,
|
||||
TOKEN_CASE
|
||||
TOKEN_CASE,
|
||||
TOKEN_EXPORT
|
||||
};
|
||||
|
||||
struct token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue