cex: indent the diagnostics to highlight the structure

Instead of

    Shift/reduce conflict on token D:
    Example              A a • D
    First derivation     s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ]
    Example              A a • D
    Second derivation    s ::=[ A a d ::=[ • D ] ]

display

    Shift/reduce conflict on token D:
      Example              A a • D
      First derivation     s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ]
      Example              A a • D
      Second derivation    s ::=[ A a d ::=[ • D ] ]

* src/counterexample.c (print_counterexample): Indent.
* tests/counterexample.at: Adjust.
This commit is contained in:
Akim Demaille
2020-06-13 19:18:12 +02:00
parent 22f62414f9
commit 35c0fe6789
2 changed files with 104 additions and 104 deletions

View File

@@ -102,14 +102,14 @@ free_counterexample (counterexample *cex)
static void
print_counterexample (counterexample *cex, FILE *out)
{
fprintf (out, "%-20s ", cex->unifying ? _("Example") : _("First example"));
fprintf (out, " %-20s ", cex->unifying ? _("Example") : _("First example"));
derivation_print_leaves (cex->d1, out);
fprintf (out, "%-20s ", _("First derivation"));
fprintf (out, " %-20s ", _("First derivation"));
derivation_print (cex->d1, out);
fprintf (out, "%-20s ", cex->unifying ? _("Example") : _("Second example"));
fprintf (out, " %-20s ", cex->unifying ? _("Example") : _("Second example"));
derivation_print_leaves (cex->d2, out);
fprintf (out, "%-20s ", _("Second derivation"));
fprintf (out, " %-20s ", _("Second derivation"));
derivation_print (cex->d2, out);
fputc ('\n', out);