mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
diagnostics: don't print ellipsis on the caret line
From
9 | ...TUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKL
| ... ^~~~~~~~~~~~~~~~~~~~~~~~~~
to
9 | ...TUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHI...
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
* src/location.c (location_caret): here.
* tests/diagnostics.at: Adjust expectations.
This commit is contained in:
@@ -388,9 +388,8 @@ location_caret (location loc, const char *style, FILE *out)
|
||||
|
||||
/* Print the carets with the same indentation as above. */
|
||||
{
|
||||
fprintf (out, " | %s%*s",
|
||||
skip ? "..." : "",
|
||||
loc.start.column - 1 - skip, "");
|
||||
fprintf (out, " | %*s",
|
||||
loc.start.column - 1 - skip + (skip ? 3 : 0), "");
|
||||
begin_use_class (style, out);
|
||||
putc ('^', out);
|
||||
/* Underlining a multiline location ends with the first
|
||||
|
||||
Reference in New Issue
Block a user