%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");
}
%nonassoc NAME.
-%fallback NAME FREE SET LET RETURN LIB INT.
+%fallback NAME FREE SET LET RETURN LIB INT UNSIGNED.
file ::= blocks.
blocks ::= block.
blocks ::= blocks block.
+block ::= EOF.
+
block ::= LIB(T) QUOTED_STRING(libname) EOS. {
if (P->psi.file.ln) {
PSI_ParserSyntaxError(P, P->psi.file.ln, T->line, "Extra 'lib %s' statement has no effect", libname->text);