c++: trailing end-of-lines in %parse-param

* src/parse-gram.y (add_param): No only skip ' ' and '\t', skip all
leading and trailing spaces.
* tests/regression.at (Lex and parse params): Check it.
* NEWS: Document it.
This commit is contained in:
Akim Demaille
2012-07-31 14:18:39 +02:00
parent d61e59ea0e
commit c9d546b2a8
3 changed files with 94 additions and 4 deletions

View File

@@ -734,11 +734,13 @@ add_param (char const *type, char *decl, location loc)
/* Strip the surrounding '{' and '}', and any blanks just inside
the braces. */
while (*--p == ' ' || *p == '\t')
continue;
--p;
while (isspace ((unsigned char) *p))
--p;
p[1] = '\0';
while (*++decl == ' ' || *decl == '\t')
continue;
++decl;
while (isspace ((unsigned char) *decl))
++decl;
if (! name_start)
complain_at (loc, _("missing identifier in parameter declaration"));