mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
* src/parse-gram.y (add_param): Fix the truncation of trailing
spaces.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2004-10-06 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/parse-gram.y (add_param): Fix the truncation of trailing
|
||||||
|
spaces.
|
||||||
|
|
||||||
2004-10-05 Akim Demaille <akim@epita.fr>
|
2004-10-05 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
|
In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
|
||||||
|
|||||||
@@ -2024,17 +2024,18 @@ add_param (char const *type, char *decl, location loc)
|
|||||||
char const *name_start = NULL;
|
char const *name_start = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
for (p = decl; *p; p++)
|
for (p = decl; p[1]; p++)
|
||||||
if ((p == decl
|
if ((p == decl
|
||||||
|| ! memchr (alphanum, p[-1], sizeof alphanum))
|
|| ! memchr (alphanum, p[-1], sizeof alphanum))
|
||||||
&& memchr (alphanum, p[0], sizeof alphanum - 10))
|
&& memchr (alphanum, p[0], sizeof alphanum - 10))
|
||||||
name_start = p;
|
name_start = p;
|
||||||
|
fprintf (stderr, "DECLI: {%s}(%c)\n", decl, *p);
|
||||||
/* Strip the surrounding '{' and '}', and any blanks just inside
|
/* Strip the surrounding '{' and '}', and any blanks just inside
|
||||||
the braces. */
|
the braces. */
|
||||||
while (*--p == ' ' || *p == '\t')
|
while (*--p == ' ' || *p == '\t')
|
||||||
continue;
|
continue;
|
||||||
*p = '\0';
|
p[1] = '\0';
|
||||||
|
fprintf (stderr, "DECLO: {%s}\n", decl);
|
||||||
while (*++decl == ' ' || *decl == '\t')
|
while (*++decl == ' ' || *decl == '\t')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -480,7 +480,8 @@ add_param (char const *type, char *decl, location loc)
|
|||||||
char const *name_start = NULL;
|
char const *name_start = NULL;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
for (p = decl; *p; p++)
|
/* Stop on last actual character. */
|
||||||
|
for (p = decl; p[1]; p++)
|
||||||
if ((p == decl
|
if ((p == decl
|
||||||
|| ! memchr (alphanum, p[-1], sizeof alphanum))
|
|| ! memchr (alphanum, p[-1], sizeof alphanum))
|
||||||
&& memchr (alphanum, p[0], sizeof alphanum - 10))
|
&& memchr (alphanum, p[0], sizeof alphanum - 10))
|
||||||
@@ -490,7 +491,7 @@ add_param (char const *type, char *decl, location loc)
|
|||||||
the braces. */
|
the braces. */
|
||||||
while (*--p == ' ' || *p == '\t')
|
while (*--p == ' ' || *p == '\t')
|
||||||
continue;
|
continue;
|
||||||
*p = '\0';
|
p[1] = '\0';
|
||||||
while (*++decl == ' ' || *decl == '\t')
|
while (*++decl == ' ' || *decl == '\t')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user