* 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:
Akim Demaille
2001-10-02 16:17:41 +00:00
parent f1394282f0
commit d9302e4b73
4 changed files with 51 additions and 25 deletions
+6
View File
@@ -1,3 +1,9 @@
2001-10-02 Akim Demaille <[email protected]>
* 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 <[email protected]>
* tests/regression.at (Invalid input): New.
+16 -15
View File
@@ -1,24 +1,25 @@
Bison was originally written by Robert Corbett. It would not be what
it is today without the invaluable help of these people:
Akim Demaille [email protected]
Akim Demaille [email protected]
Albert Chin-A-Young [email protected]
Daniel Hagerty [email protected]
David J. MacKenzie djm@gnu.org
Fabrice Bauzac [email protected]
Hans Aberg [email protected]
Jesse Thilo [email protected]
Jim Meyering meyering@gnu.org
Juan Manuel Guerrero [email protected]
Keith Browne [email protected]
Laurent Mascherpa [email protected]
Alexander Belopolsky [email protected]
Daniel Hagerty hag@gnu.org
David J. MacKenzie [email protected]
Fabrice Bauzac [email protected]
Hans Aberg [email protected]
Jesse Thilo jthilo@gnu.org
Jim Meyering [email protected]
Juan Manuel Guerrero [email protected]
Keith Browne [email protected]
Laurent Mascherpa [email protected]
Marc Autret [email protected]
Neil Booth [email protected]
Noah Friedman [email protected]
Neil Booth [email protected]
Noah Friedman [email protected]
Pascal Bart [email protected]
Paul Eggert [email protected]
Piotr Gackiewicz [email protected]
Richard Stallman [email protected]
Paul Eggert [email protected]
Piotr Gackiewicz [email protected]
Richard Stallman [email protected]
Robert Anisko [email protected]
Shura [email protected]
+7 -10
View File
@@ -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;
}
+22
View File
@@ -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)