mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-28 13:43:02 +00:00
* tests/regression.at (Invalid CPP headers): New.
From Alexander Belopolsky. * src/files.c (compute_header_macro): Map non alnum chars to `_'.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2001-10-02 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* tests/regression.at (Invalid CPP headers): New.
|
||||
From Alexander Belopolsky.
|
||||
* src/files.c (compute_header_macro): Map non alnum chars to `_'.
|
||||
|
||||
2001-10-02 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* tests/regression.at (Invalid input): New.
|
||||
|
||||
1
THANKS
1
THANKS
@@ -3,6 +3,7 @@ it is today without the invaluable help of these people:
|
||||
|
||||
Akim Demaille akim@epita.fr
|
||||
Albert Chin-A-Young china@thewrittenword.com
|
||||
Alexander Belopolsky alexb@rentec.com
|
||||
Daniel Hagerty hag@gnu.org
|
||||
David J. MacKenzie djm@gnu.org
|
||||
Fabrice Bauzac noon@cote-dazur.com
|
||||
|
||||
17
src/files.c
17
src/files.c
@@ -94,8 +94,7 @@ stringappend (const char *string1, const char *string2)
|
||||
static char *
|
||||
compute_header_macro (void)
|
||||
{
|
||||
int ite;
|
||||
char *macro_name;
|
||||
char *macro_name, *cp;
|
||||
|
||||
if (spec_defines_file)
|
||||
macro_name = xstrdup (spec_defines_file);
|
||||
@@ -109,14 +108,12 @@ compute_header_macro (void)
|
||||
strcat (macro_name, header_extension);
|
||||
}
|
||||
|
||||
for (ite = 0; macro_name[ite]; ite++)
|
||||
if (macro_name[ite] == '.')
|
||||
macro_name[ite] = '_';
|
||||
else
|
||||
{
|
||||
if (islower (macro_name[ite]))
|
||||
macro_name[ite] -= ('a' - 'A');
|
||||
}
|
||||
for (cp = macro_name; *cp; ++cp)
|
||||
if (islower (*cp))
|
||||
*cp = toupper (*cp);
|
||||
else if (!isalnum (*cp))
|
||||
*cp = '_';
|
||||
|
||||
return macro_name;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,3 +107,25 @@ input.y:3: fatal error: no rules in the input grammar
|
||||
])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## --------------------- ##
|
||||
## Invalid CPP headers. ##
|
||||
## --------------------- ##
|
||||
|
||||
AT_SETUP([Invalid CPP headers])
|
||||
|
||||
mkdir input
|
||||
|
||||
AT_DATA([input/input.y],
|
||||
[%%
|
||||
dummy:
|
||||
])
|
||||
|
||||
AT_CHECK([bison --defines input/input.y])
|
||||
|
||||
AT_CHECK([sed 1q input/input.tab.h], 0,
|
||||
[[#ifndef INPUT_INPUT_TAB_H
|
||||
]])
|
||||
|
||||
AT_CLEANUP(input)
|
||||
|
||||
Reference in New Issue
Block a user