X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fparser_proc.y;h=c18cec917ba8a9dcc7d22fa864c9369550617bd2;hp=99054b671fc61223fa5f101c5fa54c538f13ba2c;hb=93b5629631b3bfdbb9f06a9036f85f1caf370466;hpb=4b5ceb304b924c50eaf8263ad394493ff806fed4 diff --git a/src/parser_proc.y b/src/parser_proc.y index 99054b6..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"); @@ -23,13 +23,15 @@ } %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);