* src/output.c (header_output): Don't forget to export YYLTYPE and

yylloc.
* tests/headers.at (export YYLTYPE): New, make sure it does.
* tests/regression.at (%union and --defines, Invalid CPP headers):
Move to...
* tests/headers.at: here.
This commit is contained in:
Akim Demaille
2001-12-29 14:26:49 +00:00
parent aea13e9790
commit b9cecb91a0
6 changed files with 160 additions and 54 deletions

View File

@@ -1128,6 +1128,26 @@ yystype;\n\
if (!pure_parser)
fprintf (out, "\nextern YYSTYPE %slval;\n",
spec_name_prefix);
if (locations_flag)
{
fputs ("\n\n", out);
fprintf (out, "\
#ifndef YYLTYPE\n\
typedef struct yyltype\n\
{\n\
int first_line;\n\
int first_column;\n\
int last_line;\n\
int last_column;\n\
} yyltype;\n\
# define YYLTYPE yyltype\n\
#endif\n");
if (!pure_parser)
fprintf (out, "\nextern YYLTYPE %slloc;\n",
spec_name_prefix);
}
if (semantic_parser)
{
int i;