X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=lexer.c;h=1bea430edd36b1929505d8baf2fba3b7b9457cde;hb=b81b5d8c4defdbb034672786d7b589c5f7b59daf;hp=2c6bcb0b9ebc94b3309816fec313ed95af3b6218;hpb=4f611475de9b371b1a02aa6eff215c7d6c87085d;p=xonotic%2Fgmqcc.git diff --git a/lexer.c b/lexer.c index 2c6bcb0..1bea430 100644 --- a/lexer.c +++ b/lexer.c @@ -466,6 +466,8 @@ int lex_do(lex_file *lex) case ',': + case '#': + return (lex->tok->ttype = ch); default: break; @@ -577,9 +579,12 @@ int lex_do(lex_file *lex) } else if (!strcmp(v, "vector")) { lex->tok->ttype = TOKEN_TYPENAME; lex->tok->constval.t = TYPE_VECTOR; - } else if (!strcmp(v, "for") || - !strcmp(v, "while") || - !strcmp(v, "do")) + } else if (!strcmp(v, "for") || + !strcmp(v, "while") || + !strcmp(v, "do") || + !strcmp(v, "var") || + !strcmp(v, "return") || + !strcmp(v, "const")) lex->tok->ttype = TOKEN_KEYWORD; return lex->tok->ttype;