mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
moving ftepp_delete out of ftepp_preprocess so that it can actually be called recursively
This commit is contained in:
parent
03f0e39f7f
commit
99dd208880
1 changed files with 12 additions and 3 deletions
15
ftepp.c
15
ftepp.c
|
@ -827,7 +827,6 @@ static bool ftepp_preprocess(ftepp_t *ftepp)
|
||||||
} while (!ftepp->errors && ftepp->token < TOKEN_EOF);
|
} while (!ftepp->errors && ftepp->token < TOKEN_EOF);
|
||||||
|
|
||||||
newline = ftepp->token == TOKEN_EOF;
|
newline = ftepp->token == TOKEN_EOF;
|
||||||
ftepp_delete(ftepp);
|
|
||||||
return newline;
|
return newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,7 +838,12 @@ bool ftepp_preprocess_file(const char *filename)
|
||||||
con_out("failed to open file \"%s\"\n", filename);
|
con_out("failed to open file \"%s\"\n", filename);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return ftepp_preprocess(ftepp);
|
if (!ftepp_preprocess(ftepp)) {
|
||||||
|
ftepp_delete(ftepp);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ftepp_delete(ftepp);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ftepp_preprocess_string(const char *name, const char *str)
|
bool ftepp_preprocess_string(const char *name, const char *str)
|
||||||
|
@ -850,5 +854,10 @@ bool ftepp_preprocess_string(const char *name, const char *str)
|
||||||
con_out("failed to create lexer for string \"%s\"\n", name);
|
con_out("failed to create lexer for string \"%s\"\n", name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return ftepp_preprocess(ftepp);
|
if (!ftepp_preprocess(ftepp)) {
|
||||||
|
ftepp_delete(ftepp);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ftepp_delete(ftepp);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue