mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 01:33:03 +00:00
cex: improve readability of the subsections
Now that the derivation is no longer printed on one line, aligning the example and the derivation is no longer useful. It can actually be harmful, as it makes the overall structure less clear. * src/derivation.h, src/derivation.c (derivation_print_leaves): Remove the `prefix` argument. * src/counterexample.c (print_counterexample): Put the example next to its label. * tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at, * tests/report.at: Adjust.
This commit is contained in:
@@ -116,9 +116,9 @@ static void
|
||||
print_counterexample (const counterexample *cex, FILE *out, const char *prefix)
|
||||
{
|
||||
const bool flat = getenv ("YYFLAT");
|
||||
fprintf (out, " %s%-20s ",
|
||||
fprintf (out, flat ? " %s%-20s " : " %s%s: ",
|
||||
prefix, cex->unifying ? _("Example") : _("First example"));
|
||||
derivation_print_leaves (cex->d1, out, prefix);
|
||||
derivation_print_leaves (cex->d1, out);
|
||||
fprintf (out, flat ? " %s%-20s " : " %s%s",
|
||||
prefix, cex->shift_reduce ? _("Shift derivation") : _("First derivation"));
|
||||
derivation_print (cex->d1, out, prefix);
|
||||
@@ -128,9 +128,9 @@ print_counterexample (const counterexample *cex, FILE *out, const char *prefix)
|
||||
// to see the differences.
|
||||
if (!cex->unifying || is_styled (stderr))
|
||||
{
|
||||
fprintf (out, " %s%-20s ",
|
||||
fprintf (out, flat ? " %s%-20s " : " %s%s: ",
|
||||
prefix, cex->unifying ? _("Example") : _("Second example"));
|
||||
derivation_print_leaves (cex->d2, out, prefix);
|
||||
derivation_print_leaves (cex->d2, out);
|
||||
}
|
||||
fprintf (out, flat ? " %s%-20s " : " %s%s",
|
||||
prefix, cex->shift_reduce ? _("Reduce derivation") : _("Second derivation"));
|
||||
|
||||
Reference in New Issue
Block a user