lexer: Add tokens for LPAREN + RPAREN
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -259,6 +259,14 @@ lexer_scan(struct rifle_state *state, struct token *res)
|
||||
res->type = TT_COLON;
|
||||
res->c = c;
|
||||
return 0;
|
||||
case '(':
|
||||
res->type = TT_LPAREN;
|
||||
res->c = c;
|
||||
return 0;
|
||||
case ')':
|
||||
res->type = TT_RPAREN;
|
||||
res->c = c;
|
||||
return 0;
|
||||
default:
|
||||
if (lexer_scan_ident(state, c, res) == 0) {
|
||||
lexer_check_kw(state, res);
|
||||
|
||||
@@ -41,6 +41,8 @@ static const char *toktab[] = {
|
||||
[TT_STAR] = qtok("*"),
|
||||
[TT_SLASH] = qtok("/"),
|
||||
[TT_COLON] = qtok(":"),
|
||||
[TT_LPAREN] = qtok("("),
|
||||
[TT_RPAREN] = qtok(")"),
|
||||
[TT_F] = qtok(".f"),
|
||||
[TT_EXTERN] = qtok(".extern")
|
||||
};
|
||||
|
||||
@@ -12,6 +12,8 @@ typedef enum {
|
||||
TT_STAR, /* '*' */
|
||||
TT_SLASH, /* '/' */
|
||||
TT_COLON, /* ':' */
|
||||
TT_LPAREN, /* '(' */
|
||||
TT_RPAREN, /* ')' */
|
||||
TT_F, /* '.f' */
|
||||
TT_EXTERN, /* '.extern' */
|
||||
} tt_t;
|
||||
|
||||
Reference in New Issue
Block a user