From: Michael Wallner Date: Fri, 27 Nov 2015 14:28:18 +0000 (+0100) Subject: EOF syntax error X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=commitdiff_plain;h=93b5629631b3bfdbb9f06a9036f85f1caf370466;hp=14c98cac21b8102d1d4c2a57744f6976ea3a0849 EOF syntax error --- diff --git a/src/parser_proc.y b/src/parser_proc.y index ac7c117..c18cec9 100644 --- a/src/parser_proc.y +++ b/src/parser_proc.y @@ -15,7 +15,7 @@ %extra_argument {PSI_Parser *P} /* TOKEN is defined inside syntax_error */ %syntax_error { - if (TOKEN) { + if (TOKEN && TOKEN->type != PSI_T_EOF) { PSI_ParserSyntaxError(P, P->psi.file.fn, P->line, "Unexpected token '%s'", TOKEN->text); } else { PSI_ParserSyntaxError(P, P->psi.file.fn, P->line, "Unexpected end of input");