mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
debug: improve the display of symbol lists
* src/symtab.c (symbol_print): Remove useless quotes (the symbol already has quotes). Prefer fputs. * src/symlist.c (symbol_list_syms_print): Likewise. Fix separators.
This commit is contained in:
@@ -84,12 +84,17 @@ symbol_list_type_new (uniqstr type_name, location loc)
|
|||||||
void
|
void
|
||||||
symbol_list_syms_print (const symbol_list *l, FILE *f)
|
symbol_list_syms_print (const symbol_list *l, FILE *f)
|
||||||
{
|
{
|
||||||
|
char const *sep = "";
|
||||||
for (/* Nothing. */; l && l->content.sym; l = l->next)
|
for (/* Nothing. */; l && l->content.sym; l = l->next)
|
||||||
{
|
{
|
||||||
|
fputs (sep, f);
|
||||||
|
fputs (l->content_type == SYMLIST_SYMBOL ? "symbol: "
|
||||||
|
: l->content_type == SYMLIST_TYPE ? "type: "
|
||||||
|
: "invalid content_type: ",
|
||||||
|
f);
|
||||||
symbol_print (l->content.sym, f);
|
symbol_print (l->content.sym, f);
|
||||||
fprintf (f, l->action_props.is_value_used ? " used" : " unused");
|
fputs (l->action_props.is_value_used ? " used" : " unused", f);
|
||||||
if (l && l->content.sym)
|
sep = ", ";
|
||||||
fprintf (f, ", ");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,13 +153,13 @@ symbol_print (symbol const *s, FILE *f)
|
|||||||
{
|
{
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
fprintf (f, "\"%s\"", s->tag);
|
fputs (s->tag, f);
|
||||||
SYMBOL_ATTR_PRINT (type_name);
|
SYMBOL_ATTR_PRINT (type_name);
|
||||||
SYMBOL_CODE_PRINT (destructor);
|
SYMBOL_CODE_PRINT (destructor);
|
||||||
SYMBOL_CODE_PRINT (printer);
|
SYMBOL_CODE_PRINT (printer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf (f, "<NULL>");
|
fputs ("<NULL>", f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef SYMBOL_ATTR_PRINT
|
#undef SYMBOL_ATTR_PRINT
|
||||||
|
|||||||
Reference in New Issue
Block a user