lexer: Add token for semicolon
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -333,6 +333,10 @@ lexer_scan(struct rifle_state *state, struct token *res)
|
||||
res->type = TT_RBRACE;
|
||||
res->c = c;
|
||||
return 0;
|
||||
case ';':
|
||||
res->type = TT_SEMI;
|
||||
res->c = c;
|
||||
return 0;
|
||||
case '#':
|
||||
if ((c = lexer_nom(state, false)) == '\0') {
|
||||
trace_error(state, "unexpected end of file\n");
|
||||
|
||||
@@ -55,6 +55,7 @@ static const char *toktab[] = {
|
||||
[TT_RPAREN] = qtok(")"),
|
||||
[TT_LBRACE] = qtok("{"),
|
||||
[TT_RBRACE] = qtok("}"),
|
||||
[TT_SEMI] = qtok(";"),
|
||||
[TT_F] = qtok(".f"),
|
||||
[TT_EXTERN] = qtok(".extern"),
|
||||
[TT_DEFINE] = qtok("#define"),
|
||||
|
||||
@@ -16,6 +16,7 @@ typedef enum {
|
||||
TT_RPAREN, /* ')' */
|
||||
TT_LBRACE, /* '{' */
|
||||
TT_RBRACE, /* '}' */
|
||||
TT_SEMI, /* ';' */
|
||||
TT_F, /* '.f' */
|
||||
TT_EXTERN, /* '.extern' */
|
||||
TT_DEFINE, /* '#define' */
|
||||
|
||||
Reference in New Issue
Block a user