mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
* 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:
@@ -158,7 +158,8 @@ braced_code_t current_braced_code = action_braced_code;
|
||||
|
||||
|
||||
%type <string> STRING string_content
|
||||
BRACED_CODE PROLOGUE EPILOGUE epilogue.opt action
|
||||
BRACED_CODE action
|
||||
PROLOGUE EPILOGUE
|
||||
%type <struniq> TYPE
|
||||
%type <integer> INT
|
||||
%type <symbol> ID symbol string_as_id
|
||||
@@ -170,7 +171,6 @@ input:
|
||||
declarations "%%" grammar epilogue.opt
|
||||
{
|
||||
yycontrol->errcode = 0;
|
||||
epilogue_set ($4, @4);
|
||||
}
|
||||
;
|
||||
|
||||
@@ -418,12 +418,10 @@ string_content:
|
||||
|
||||
epilogue.opt:
|
||||
/* Nothing. */
|
||||
{
|
||||
$$ = xstrdup ("");
|
||||
}
|
||||
| "%%" EPILOGUE
|
||||
{
|
||||
$$ = $2;
|
||||
epilogue_augment ($2, @2);
|
||||
scanner_last_string_free ();
|
||||
}
|
||||
;
|
||||
|
||||
@@ -464,6 +462,10 @@ yyprint (FILE *file,
|
||||
case EPILOGUE:
|
||||
fprintf (file, " = {{ %s }}", value->string);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (file, "unknown token type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user