mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 22:31:36 +00:00
handling the noops flag better now
This commit is contained in:
parent
6ab09ef3bf
commit
bdd8b8275e
1 changed files with 3 additions and 5 deletions
8
ftepp.c
8
ftepp.c
|
@ -207,7 +207,6 @@ static bool ftepp_if_expr(ftepp_t *ftepp, bool *out)
|
|||
case TOKEN_TYPENAME:
|
||||
case TOKEN_KEYWORD:
|
||||
if (!strcmp(ftepp_tokval(ftepp), "defined")) {
|
||||
ftepp->lex->flags.noops = true;
|
||||
ftepp_next(ftepp);
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
|
@ -215,7 +214,6 @@ static bool ftepp_if_expr(ftepp_t *ftepp, bool *out)
|
|||
ftepp_error(ftepp, "`defined` keyword in #if requires a macro name in parenthesis");
|
||||
return false;
|
||||
}
|
||||
ftepp->lex->flags.noops = false;
|
||||
ftepp_next(ftepp);
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
|
@ -281,9 +279,11 @@ static bool ftepp_if_expr(ftepp_t *ftepp, bool *out)
|
|||
return false;
|
||||
}
|
||||
|
||||
ftepp->lex->flags.noops = false;
|
||||
ftepp_next(ftepp);
|
||||
if (!ftepp_skipspace(ftepp))
|
||||
return false;
|
||||
ftepp->lex->flags.noops = true;
|
||||
|
||||
if (ftepp->token == ')')
|
||||
return true;
|
||||
|
@ -317,8 +317,6 @@ static bool ftepp_if(ftepp_t *ftepp, ppcondition *cond)
|
|||
{
|
||||
bool result = false;
|
||||
|
||||
ftepp->lex->flags.noops = false;
|
||||
|
||||
memset(cond, 0, sizeof(*cond));
|
||||
(void)ftepp_next(ftepp);
|
||||
|
||||
|
@ -331,7 +329,6 @@ static bool ftepp_if(ftepp_t *ftepp, ppcondition *cond)
|
|||
|
||||
if (!ftepp_if_expr(ftepp, &result))
|
||||
return false;
|
||||
ftepp->lex->flags.noops = true;
|
||||
|
||||
cond->on = result;
|
||||
return true;
|
||||
|
@ -507,6 +504,7 @@ static bool ftepp_preprocess(ftepp_t *ftepp)
|
|||
bool newline = true;
|
||||
|
||||
ftepp->lex->flags.preprocessing = true;
|
||||
ftepp->lex->flags.noops = true;
|
||||
|
||||
ftepp_next(ftepp);
|
||||
do
|
||||
|
|
Loading…
Reference in a new issue