Try to fix Bison portability issue

YYEOF works as a token for "end of file" on my dev box but fails in
CI.  I assume it must be a Bison version difference.

Based on the Bison manual, I'm trying this fix (which also works on my
dev box).
This commit is contained in:
Olly Betts 2022-01-27 20:17:21 +13:00
commit bb011e28a9

View file

@ -1587,6 +1587,9 @@ static String *add_qualifier_to_declarator(SwigType *type, SwigType *qualifier)
Node *node;
};
// Define special token END for end of input.
%token END 0
%token <id> ID
%token <str> HBLOCK
%token <id> POUND
@ -2010,7 +2013,7 @@ constant_directive : CONSTANT identifier EQUAL definetype SEMI {
Swig_warning(WARN_PARSE_BAD_VALUE,cparse_file,cparse_line,"Bad constant value (ignored).\n");
$$ = 0;
}
| CONSTANT error YYEOF {
| CONSTANT error END {
Swig_error(cparse_file,cparse_line,"Missing ';' after %%constant.\n");
SWIG_exit(EXIT_FAILURE);
}