X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d08290769c798befc27e9f8bbc3f1a3da12d1f08..8dd162d3ff10fd7fb6f748a885f8055232691c48:/src/reader.c diff --git a/src/reader.c b/src/reader.c index a1baa8ee..1cd035cc 100644 --- a/src/reader.c +++ b/src/reader.c @@ -41,6 +41,9 @@ merger_list *merge_functions; /* Has %union been seen? */ bool typed = false; + +/* Should rules have a default precedence? */ +bool default_prec = true; /*-----------------------. | Set the start symbol. | @@ -78,29 +81,6 @@ prologue_augment (const char *prologue, location loc) obstack_sgrow (oout, prologue); } - - - -/*----------------------. -| Handle the epilogue. | -`----------------------*/ - -void -epilogue_augment (const char *epilogue, location loc) -{ - char *extension = NULL; - obstack_fgrow1 (&muscle_obstack, "]b4_syncline([[%d]], [[", loc.start.line); - MUSCLE_OBSTACK_SGROW (&muscle_obstack, - quotearg_style (c_quoting_style, loc.start.file)); - obstack_sgrow (&muscle_obstack, "]])[\n"); - obstack_sgrow (&muscle_obstack, epilogue); - obstack_1grow (&muscle_obstack, 0); - extension = obstack_finish (&muscle_obstack); - muscle_grow ("epilogue", extension, ""); - obstack_free (&muscle_obstack, extension); -} - - /*-------------------------------------------------------------------. @@ -432,7 +412,7 @@ packgram (void) ritem[itemno++] = symbol_number_as_item_number (p->sym->number); /* A rule gets by default the precedence and associativity of the last token in it. */ - if (p->sym->class == token_sym) + if (p->sym->class == token_sym && default_prec) rules[ruleno].prec = p->sym; if (p) p = p->next;