better handlign of a too early error condition

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-20 18:14:02 +02:00
parent e0ffcfb74b
commit 5a0995c767

View file

@ -2685,12 +2685,17 @@ bool parser_compile(const char *filename)
if (parser->tok == TOKEN_EOF)
parseerror(parser, "unexpected eof");
else if (!parser->errors)
parseerror(parser, "parse error\n");
parseerror(parser, "parse error");
lex_close(parser->lex);
parser->lex = NULL;
return false;
}
}
} else {
parseerror(parser, "parse error");
lex_close(parser->lex);
parser->lex = NULL;
return false;
}
lex_close(parser->lex);