#include "system.h"
#include <quote.h>
-#include <quotearg.h>
#include "complain.h"
#include "conflicts.h"
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
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);
}
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. */
default. */
muscle_percent_define_default ("lr.type", "lalr");
lr_type = muscle_percent_define_get ("lr.type");
- if (0 != strcmp (lr_type, "canonical-lr"))
+ if (STRNEQ (lr_type, "canonical-lr"))
muscle_percent_define_default ("lr.default-reductions", "most");
else
muscle_percent_define_default ("lr.default-reductions", "accepting");