jitters: return non-zero on parsing error

This commit is contained in:
Bruno BELANYI 2020-09-28 13:48:53 +02:00
parent 3f51857202
commit a8f4122146

View file

@ -6,11 +6,14 @@
int main(void) int main(void)
{ {
struct ast_node *res; struct ast_node *ast = NULL;
int ret = 0;
yydebug = getenv("PARSE") != NULL; yydebug = getenv("PARSE") != NULL;
if (yyparse(&res) == 0) { if ((ret = yyparse(&ast)) == 0) {
destroy_ast(res); /* Nothing */
} }
return 0; destroy_ast(ast);
return ret;
} }