X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/573a6cd3568911ec7a698daea60fa24f36088cd2..7ec2d4cd3932bfba78e9fbd52509d9f80b61c8ef:/src/parse-gram.y?ds=sidebyside diff --git a/src/parse-gram.y b/src/parse-gram.y index 74a6574f..c10c82ac 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -158,7 +158,8 @@ braced_code_t current_braced_code = action_braced_code; %type STRING string_content - BRACED_CODE PROLOGUE EPILOGUE epilogue.opt action + BRACED_CODE action + PROLOGUE EPILOGUE %type TYPE %type INT %type 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; } }