Parse error messages can be confusing
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2711
Reported by Martin Stjernholm mast@roxen.com
The define YYERROR_VERBOSE was turned on a while back, to give better error messages for parse errors by listing the expected tokens. Since many productions include TOK_LEX_EOF for error recovery, that token too is considered expected, e.g:
foo.pike:parse error, expecting TOK_LEX_EOF' or
'}'' or `')''
The TOK_LEX_EOF bit here is confusing and wrong. Ideally the error reporting code should be overridden to fix this, but it seems like bison doesn't allow that. Perhaps it's better to undefine YYERROR_VERBOSE again.