From: Akim Demaille Date: Fri, 29 Jun 2012 13:58:59 +0000 (+0200) Subject: maint: prepare forthcoming changes X-Git-Tag: v2.7.90~410 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/3e153163c7349c09938376f181ea4d8a1a02cdb5 maint: prepare forthcoming changes * src/gram.c (rule_rhs_print): Do not print new line anymore. (rule_print): Make it static. * src/closure.c, src/derives.c, src/gram.c: Adjust. --- diff --git a/src/closure.c b/src/closure.c index 929aa777..ccd05650 100644 --- a/src/closure.c +++ b/src/closure.c @@ -103,6 +103,7 @@ print_fderives (void) { fprintf (stderr, "\t\t%3d ", r); rule_rhs_print (&rules[r], stderr); + fprintf (stderr, "\n"); } } fprintf (stderr, "\n\n"); diff --git a/src/derives.c b/src/derives.c index a0afbb3e..89023929 100644 --- a/src/derives.c +++ b/src/derives.c @@ -52,6 +52,7 @@ print_derives (void) { fprintf (stderr, "\t\t%3d ", (*rp)->user_number); rule_rhs_print (*rp, stderr); + fprintf (stderr, "\n"); } } diff --git a/src/gram.c b/src/gram.c index 59e579c0..5e14c60c 100644 --- a/src/gram.c +++ b/src/gram.c @@ -105,11 +105,10 @@ rule_rhs_print (rule *r, FILE *out) item_number *rp; for (rp = r->rhs; *rp >= 0; rp++) fprintf (out, " %s", symbols[*rp]->tag); - fputc ('\n', out); } else { - fprintf (out, " /* %s */\n", _("empty")); + fprintf (out, " /* %s */", _("empty")); } } @@ -133,7 +132,7 @@ rule_rhs_print_xml (rule *r, FILE *out, int level) } } -void +static void rule_print (rule *r, FILE *out) { fprintf (out, "%s:", r->lhs->tag); @@ -189,6 +188,7 @@ grammar_rules_partial_print (FILE *out, const char *title, first = false; rule_lhs_print (&rules[r], previous_lhs, out); rule_rhs_print (&rules[r], out); + fprintf (out, "\n"); previous_lhs = rules[r].lhs; } if (!first) @@ -296,6 +296,7 @@ grammar_dump (FILE *out, const char *title) { fprintf (out, "%-5d ", r); rule_print (&rules[r], out); + fprintf (out, "\n"); } } fprintf (out, "\n\n"); @@ -313,9 +314,10 @@ grammar_rules_useless_report (const char *message) { complain_at (rules[r].location, w, "%s: ", message); rule_print (&rules[r], stderr); + fprintf (stderr, "\n"); fflush (stderr); } - } + } } void diff --git a/src/gram.h b/src/gram.h index 75b3b0a9..e502b781 100644 --- a/src/gram.h +++ b/src/gram.h @@ -229,9 +229,6 @@ size_t rule_rhs_length (rule *r); /* Print this rule's RHS on OUT. */ void rule_rhs_print (rule *r, FILE *out); -/* Print this rule on OUT. */ -void rule_print (rule *r, FILE *out); -