X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c547693afdacf4b865027d3bb8c53f601eadb5ae..423ca9b50e4321c078cc6fe7903b10ed4907d269:/src/reader.c?ds=sidebyside diff --git a/src/reader.c b/src/reader.c index 2e0aa5ee..c456cbff 100644 --- a/src/reader.c +++ b/src/reader.c @@ -257,7 +257,7 @@ grammar_current_rule_begin (symbol *lhs, location loc, static bool symbol_should_be_used (symbol_list const *s, bool *midrule_warning) { - if (symbol_destructor_get (s->content.sym)->code) + if (symbol_code_props_get (s->content.sym, destructor)->code) return true; if ((s->midrule && s->midrule->action_props.is_value_used) || (s->midrule_parent_rule @@ -333,7 +333,7 @@ grammar_rule_check (const symbol_list *r) it for char literals and strings, which are always tokens. */ if (r->ruleprec && r->ruleprec->tag[0] != '\'' && r->ruleprec->tag[0] != '"' - && !r->ruleprec->declared && !r->ruleprec->prec) + && r->ruleprec->status != declared && !r->ruleprec->prec) warn_at (r->location, _("token for %%prec is not defined: %s"), r->ruleprec->tag); } @@ -470,6 +470,8 @@ grammar_current_rule_symbol_append (symbol *sym, location loc, p = grammar_symbol_append (sym, loc); if (name) assign_named_ref(p, name); + if (sym->status == undeclared || sym->status == used) + sym->status = needed; } /* Attach an ACTION to the current rule. */