mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 21:33:04 +00:00
%merge: let mergers record a typing-symbol, rather than a type
Symbols are richer than types, and in M4 it is my simpler (and more common) to deal with symbols rather than types. So let's associate mergers to a symbol rather than a type name. * src/reader.h (merger_list): Replace the 'type' member by a symbol member. * src/reader.c (record_merge_function_type): Take a symbol as argument, rather than a type name. * src/output.c (merger_output): Adjust.
This commit is contained in:
14
src/output.c
14
src/output.c
@@ -554,14 +554,12 @@ merger_output (FILE *out)
|
||||
int n;
|
||||
merger_list* p;
|
||||
for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
|
||||
{
|
||||
if (p->type[0] == '\0')
|
||||
fprintf (out, " case %d: *yy0 = %s (*yy0, *yy1); break;\n",
|
||||
n, p->name);
|
||||
else
|
||||
fprintf (out, " case %d: yy0->%s = %s (*yy0, *yy1); break;\n",
|
||||
n, p->type, p->name);
|
||||
}
|
||||
if (p->sym && p->sym->content->type_name)
|
||||
fprintf (out, " case %d: yy0->%s = %s (*yy0, *yy1); break;\n",
|
||||
n, p->sym->content->type_name, p->name);
|
||||
else
|
||||
fprintf (out, " case %d: *yy0 = %s (*yy0, *yy1); break;\n",
|
||||
n, p->name);
|
||||
fputs ("]])\n\n", out);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user