mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
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:
12
tests/c++.at
12
tests/c++.at
@@ -248,14 +248,14 @@ exp:
|
||||
|
||||
AT_BISON_CHECK([[-fcaret input.yy]], [0], [],
|
||||
[[input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove [-Wother]
|
||||
| "twice" exp { $$ = $2 + $2; }
|
||||
^~
|
||||
16 | | "twice" exp { $$ = $2 + $2; }
|
||||
| ^~
|
||||
input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother]
|
||||
| "thrice" exp[val] { $$ = $2 + $val + $2; }
|
||||
^~~~
|
||||
17 | | "thrice" exp[val] { $$ = $2 + $val + $2; }
|
||||
| ^~~~
|
||||
input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove [-Wother]
|
||||
| "thrice" exp[val] { $$ = $2 + $val + $2; }
|
||||
^~
|
||||
17 | | "thrice" exp[val] { $$ = $2 + $val + $2; }
|
||||
| ^~
|
||||
]])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
Reference in New Issue
Block a user