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

@@ -249,13 +249,13 @@ 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; }
^^
^~
input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother]
| "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; }
^^
^~
]])
AT_BISON_OPTION_POPDEFS