} while (!ftepp->errors && ftepp->token < TOKEN_EOF);
newline = ftepp->token == TOKEN_EOF;
- ftepp_delete(ftepp);
return newline;
}
con_out("failed to open file \"%s\"\n", filename);
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)
con_out("failed to create lexer for string \"%s\"\n", name);
return false;
}
- return ftepp_preprocess(ftepp);
+ if (!ftepp_preprocess(ftepp)) {
+ ftepp_delete(ftepp);
+ return false;
+ }
+ ftepp_delete(ftepp);
+ return true;
}