summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-07-19 19:46:41 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-07-20 06:45:31 +0200
commit815a76f5583311c6d00024584d153544e9391d5d (patch)
treea7c9f0886fec408f5c7009158f9b11c4501297c5 /src
parentea138cd1f191ee1aff65c0a706a9646316538916 (diff)
downloadbison-815a76f5583311c6d00024584d153544e9391d5d.tar.gz
cex: don't issue an empty line between counterexamples
Now that we use complain, the "sections" are clearer. * src/counterexample.c (print_counterexample): Use the empty line only in reports. * tests/counterexample.at, tests/diagnostics.at, tests/report.at: Adjust.
Diffstat (limited to 'src')
-rw-r--r--src/counterexample.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/counterexample.c b/src/counterexample.c
index 426d131e..06ebcd6c 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -136,7 +136,8 @@ print_counterexample (const counterexample *cex, FILE *out, const char *prefix)
prefix, cex->shift_reduce ? _("Reduce derivation") : _("Second derivation"));
derivation_print (cex->d2, out, prefix);
- fputc ('\n', out);
+ if (out != stderr)
+ putc ('\n', out);
}
/*
@@ -1258,7 +1259,7 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it
fprintf (out, "%s\n", _(":"));
}
// In the report, print the items.
- if (*prefix || trace_flag & trace_cex)
+ if (out != stderr || trace_flag & trace_cex)
{
print_state_item (&state_items[itm1], out, prefix);
print_state_item (&state_items[itm2], out, prefix);