From 93b5629631b3bfdbb9f06a9036f85f1caf370466 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 27 Nov 2015 15:28:18 +0100 Subject: [PATCH] EOF syntax error --- src/parser_proc.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.30.2