mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
Allow multiple %union directives, whose contents concatenate. * src/parse-gram.y (grammar_declaration): Likewise. Use muscle_code_grow, so that we don't need stype_line any more. All uses changed.
This commit is contained in:
@@ -247,9 +247,19 @@ grammar_declaration:
|
||||
}
|
||||
| "%union {...}"
|
||||
{
|
||||
char const *body = $1;
|
||||
|
||||
if (typed)
|
||||
{
|
||||
/* Concatenate the union bodies, turning the first one's
|
||||
trailing '}' into '\n', and omitting the second one's '{'. */
|
||||
char *code = muscle_find ("stype");
|
||||
code[strlen (code) - 1] = '\n';
|
||||
body++;
|
||||
}
|
||||
|
||||
typed = true;
|
||||
MUSCLE_INSERT_INT ("stype_line", @1.start.line);
|
||||
muscle_insert ("stype", $1);
|
||||
muscle_code_grow ("stype", body, @1);
|
||||
}
|
||||
| "%destructor {...}" symbols.1
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user