mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
graph: minor simplification
* src/gram.c (print_lhs): Use %*s to indent. * src/print_graph.c (print_lhs): Use obstack_printf. Became simple enough to be inlined in... (print_core): here. Use a "rule*" instead of an index in "rules[]".
This commit is contained in:
11
src/gram.c
11
src/gram.c
@@ -69,16 +69,9 @@ rule_lhs_print (rule const *r, symbol const *previous_lhs, FILE *out)
|
||||
{
|
||||
fprintf (out, " %3d ", r->number);
|
||||
if (previous_lhs != r->lhs)
|
||||
{
|
||||
fprintf (out, "%s:", r->lhs->tag);
|
||||
}
|
||||
fprintf (out, "%s:", r->lhs->tag);
|
||||
else
|
||||
{
|
||||
int n;
|
||||
for (n = strlen (previous_lhs->tag); n > 0; --n)
|
||||
fputc (' ', out);
|
||||
fputc ('|', out);
|
||||
}
|
||||
fprintf (out, "%*s|", (int) strlen (previous_lhs->tag), "");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user