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:
Akim Demaille
2019-01-13 08:41:28 +01:00
parent 8c3a7687e4
commit a7ff1c75be
8 changed files with 215 additions and 215 deletions

View File

@@ -246,16 +246,16 @@ f: B
AT_BISON_CHECK([-Wprecedence -fcaret -o input.c input.y], 0, [],
[[input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence]
%nonassoc U
^^^^^^^^^
^~~~~~~~~
input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence]
%right V
^^^^^^
^~~~~~
input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence]
%left W
^^^^^
^~~~~
input.y:2.1-11: warning: useless precedence for Z [-Wprecedence]
%precedence Z
^^^^^^^^^^^
^~~~~~~~~~~
]])
AT_CLEANUP
@@ -1367,7 +1367,7 @@ b: %expect-rr 4
AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [],
[[input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 4 expected
b: %expect-rr 4
^^^^^^^^^^^^
^~~~~~~~~~~~
]])
AT_CLEANUP
@@ -1396,7 +1396,7 @@ b: %expect-rr 2
AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [],
[[input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 2 expected
b: %expect-rr 2
^^^^^^^^^^^^
^~~~~~~~~~~~
]])
AT_CLEANUP