mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
Better handling of EOF - encountering EOF in parser_next will not return false yet, this is a more elegant way...
This commit is contained in:
parent
5a0995c767
commit
0d64e555e2
1 changed files with 1 additions and 1 deletions
2
parser.c
2
parser.c
|
@ -129,7 +129,7 @@ bool parser_next(parser_t *parser)
|
||||||
/* lex_do kills the previous token */
|
/* lex_do kills the previous token */
|
||||||
parser->tok = lex_do(parser->lex);
|
parser->tok = lex_do(parser->lex);
|
||||||
if (parser->tok == TOKEN_EOF)
|
if (parser->tok == TOKEN_EOF)
|
||||||
return false;
|
return true;
|
||||||
if (parser->tok >= TOKEN_ERROR) {
|
if (parser->tok >= TOKEN_ERROR) {
|
||||||
parseerror(parser, "lex error");
|
parseerror(parser, "lex error");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue