mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 09:43:03 +00:00
* src/parse-gram.y (add_param): Strip the leading and trailing
blanks from a formal argument declaration. (YY_LOCATION_PRINT): New.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2004-09-24 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/parse-gram.y (add_param): Strip the leading and trailing
|
||||||
|
blanks from a formal argument declaration.
|
||||||
|
(YY_LOCATION_PRINT): New.
|
||||||
|
|
||||||
2004-09-24 Akim Demaille <akim@epita.fr>
|
2004-09-24 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
|
* data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
|
#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
|
||||||
static YYLTYPE lloc_default (YYLTYPE const *, int);
|
static YYLTYPE lloc_default (YYLTYPE const *, int);
|
||||||
|
|
||||||
|
#define YY_LOCATION_PRINT(File, Loc) \
|
||||||
|
location_print (File, Loc)
|
||||||
|
|
||||||
/* Request detailed syntax error messages, and pass them to GRAM_ERROR.
|
/* Request detailed syntax error messages, and pass them to GRAM_ERROR.
|
||||||
FIXME: depends on the undocumented availability of YYLLOC. */
|
FIXME: depends on the undocumented availability of YYLLOC. */
|
||||||
#undef yyerror
|
#undef yyerror
|
||||||
@@ -474,6 +477,7 @@ add_param (char const *type, char *decl, location loc)
|
|||||||
"abcdefghijklmnopqrstuvwxyz"
|
"abcdefghijklmnopqrstuvwxyz"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
"_";
|
"_";
|
||||||
|
static char const blank[] = " \t";
|
||||||
char const *alpha = alphanum + 10;
|
char const *alpha = alphanum + 10;
|
||||||
char const *name_start = NULL;
|
char const *name_start = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
@@ -484,7 +488,13 @@ add_param (char const *type, char *decl, location loc)
|
|||||||
|
|
||||||
/* Strip the surrounding '{' and '}'. */
|
/* Strip the surrounding '{' and '}'. */
|
||||||
decl++;
|
decl++;
|
||||||
p[-1] = '\0';
|
*--p = '\0';
|
||||||
|
|
||||||
|
/* Strip surrounding white spaces. */
|
||||||
|
while (strchr (blank, *decl))
|
||||||
|
++decl;
|
||||||
|
while (strchr (blank, p[-1]))
|
||||||
|
*--p = '\0';
|
||||||
|
|
||||||
if (! name_start)
|
if (! name_start)
|
||||||
complain_at (loc, _("missing identifier in parameter declaration"));
|
complain_at (loc, _("missing identifier in parameter declaration"));
|
||||||
|
|||||||
Reference in New Issue
Block a user