diagnostics: copy GCC9's format

Currently, when we quote the source file, we indent it with one space,
and preserve tabulations, so there is a discrepancy and the visual
rendering is bad.  One way out is to indent with a tab instead of a
space, but then this space can be used for more information.  This is
what GCC9 does.  Let's play copy cats.

See
https://lists.gnu.org/archive/html/bison-patches/2019-04/msg00025.html
https://developers.redhat.com/blog/2019/03/08/usability-improvements-in-gcc-9/
https://gcc.gnu.org/onlinedocs/gccint/Guidelines-for-Diagnostics.html#Guidelines-for-Diagnostics

* src/location.c (location_caret): Prefix quoted lines with the line
number and a pipe, fitting 8 columns.

* tests/actions.at, tests/c++.at, tests/conflicts.at,
* tests/diagnostics.at, tests/input.at, tests/java.at,
* tests/named-refs.at, tests/reduce.at, tests/regression.at,
* tests/sets.at: Adjust expectations.
Partly by "./build-aux/update-test tests/testsuite.dir/*/testsuite.log"
repeatedly, and partly by hand.
This commit is contained in:
Akim Demaille
2019-04-22 07:52:38 +02:00
parent afe7dfd3b9
commit a9b350fb3a
11 changed files with 502 additions and 502 deletions

View File

@@ -35,8 +35,8 @@ exp:
AT_BISON_CHECK([[-fcaret YYParser.y]], [1], [],
[[YYParser.y: error: %defines does not make sense in Java
YYParser.y:4.13-30: error: %destructor does not make sense in Java
%destructor { /* Nothing. */ } exp
^~~~~~~~~~~~~~~~~~
4 | %destructor { /* Nothing. */ } exp
| ^~~~~~~~~~~~~~~~~~
]])
AT_CLEANUP