mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
moving ftepp_out further up, using it in ftepp_macro_call, generating output of parameter-less macros
This commit is contained in:
parent
5f287fc476
commit
6c0b4a46fe
1 changed files with 19 additions and 10 deletions
29
ftepp.c
29
ftepp.c
|
@ -147,6 +147,16 @@ void ftepp_delete(ftepp_t *self)
|
|||
mem_d(self);
|
||||
}
|
||||
|
||||
static void ftepp_out(ftepp_t *ftepp, const char *str, bool ignore_cond)
|
||||
{
|
||||
if (ignore_cond ||
|
||||
!vec_size(ftepp->conditions) ||
|
||||
vec_last(ftepp->conditions).on)
|
||||
{
|
||||
printf("%s", str);
|
||||
}
|
||||
}
|
||||
|
||||
ppmacro* ftepp_macro_find(ftepp_t *ftepp, const char *name)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -280,7 +290,16 @@ static bool ftepp_define(ftepp_t *ftepp)
|
|||
|
||||
static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro)
|
||||
{
|
||||
size_t o;
|
||||
ftepp_next(ftepp);
|
||||
|
||||
if (!macro->has_params) {
|
||||
for (o = 0; o < vec_size(macro->output); ++o) {
|
||||
ftepp_out(ftepp, macro->output[o]->value, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!ftepp_skipallwhite(ftepp))
|
||||
return false;
|
||||
return true;
|
||||
|
@ -611,16 +630,6 @@ static bool ftepp_hash(ftepp_t *ftepp)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void ftepp_out(ftepp_t *ftepp, const char *str, bool ignore_cond)
|
||||
{
|
||||
if (ignore_cond ||
|
||||
!vec_size(ftepp->conditions) ||
|
||||
vec_last(ftepp->conditions).on)
|
||||
{
|
||||
printf("%s", str);
|
||||
}
|
||||
}
|
||||
|
||||
static bool ftepp_preprocess(ftepp_t *ftepp)
|
||||
{
|
||||
ppmacro *macro;
|
||||
|
|
Loading…
Reference in a new issue