diff --git a/core/lexer.c b/core/lexer.c index d782a32..06e0e73 100644 --- a/core/lexer.c +++ b/core/lexer.c @@ -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"); diff --git a/core/parser.c b/core/parser.c index 35fc51b..92f65bc 100644 --- a/core/parser.c +++ b/core/parser.c @@ -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"), diff --git a/inc/rifle/token.h b/inc/rifle/token.h index b4fbc25..4b14f23 100644 --- a/inc/rifle/token.h +++ b/inc/rifle/token.h @@ -16,6 +16,7 @@ typedef enum { TT_RPAREN, /* ')' */ TT_LBRACE, /* '{' */ TT_RBRACE, /* '}' */ + TT_SEMI, /* ';' */ TT_F, /* '.f' */ TT_EXTERN, /* '.extern' */ TT_DEFINE, /* '#define' */