mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
diagnostics: prefer ^~~~ to ^^^^ to underline code
That's what both GCC and Clang do, and it is indeed much nicer to
read. From:
foo.y:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated]
%error-verbose
^^^^^^^^^^^^^^
foo.y:4.1-20: warning: deprecated directive, use '%define api.prefix {foo}' [-Wdeprecated]
%name-prefix = "foo"
^^^^^^^^^^^^^^^^^^^^
to:
foo.y:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated]
%error-verbose
^~~~~~~~~~~~~~
foo.y:4.1-20: warning: deprecated directive, use '%define api.prefix {foo}' [-Wdeprecated]
%name-prefix = "foo"
^~~~~~~~~~~~~~~~~~~~
* src/location.c (location_caret): Use ^~~~.
Adjust tests expectations.
This commit is contained in:
@@ -209,7 +209,7 @@ location_caret (location loc, FILE *out)
|
||||
/* Print the carets (at least one), with the same indent as above.*/
|
||||
fprintf (out, " %*s", loc.start.column - 1, "");
|
||||
for (i = loc.start.column; i == loc.start.column || i < len; ++i)
|
||||
putc ('^', out);
|
||||
putc (i == loc.start.column ? '^' : '~', out);
|
||||
}
|
||||
putc ('\n', out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user