* src/scan-gram.l, src/reader.h (scanner_last_string_free):

Restore.
* src/scan-gram.l (last_string): Is global to the file, not to
yylex.
* src/parse-gram.y (input): Don't append the epilogue here,
(epilogue.opt): do it here, and free the scanner's obstack.
* src/reader.c (epilogue_set): Rename as...
(epilogue_augment): this.
* data/c.m4 (b4_epilogue): Defaults to empty.
This commit is contained in:
Akim Demaille
2002-11-12 08:26:38 +00:00
parent 573a6cd356
commit 7ec2d4cd39
7 changed files with 56 additions and 27 deletions

View File

@@ -84,8 +84,9 @@ prologue_augment (const char *prologue, location_t location)
`----------------------*/
void
epilogue_set (const char *epilogue, location_t location)
epilogue_augment (const char *epilogue, location_t location)
{
char *extension = NULL;
obstack_fgrow1 (&muscle_obstack, "]b4_syncline([[%d]], [[",
location.first_line);
MUSCLE_OBSTACK_SGROW (&muscle_obstack,
@@ -93,7 +94,9 @@ epilogue_set (const char *epilogue, location_t location)
obstack_sgrow (&muscle_obstack, "]])[\n");
obstack_sgrow (&muscle_obstack, epilogue);
obstack_1grow (&muscle_obstack, 0);
muscle_insert ("epilogue", obstack_finish (&muscle_obstack));
extension = obstack_finish (&muscle_obstack);
muscle_grow ("epilogue", extension, "");
obstack_free (&muscle_obstack, extension);
}