mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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:
@@ -130,7 +130,7 @@ b: {} {};
|
||||
AT_BISON_CHECK([-fcaret -Wempty-rule 1.y], [0], [],
|
||||
[[1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
|
||||
a: /* empty. */ {};
|
||||
^^
|
||||
^~
|
||||
]])
|
||||
|
||||
AT_DATA_GRAMMAR([[2.y]],
|
||||
@@ -144,10 +144,10 @@ c: /* empty. */ {};
|
||||
AT_BISON_CHECK([-fcaret 2.y], [0], [],
|
||||
[[2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
|
||||
a: /* empty. */ {};
|
||||
^^
|
||||
^~
|
||||
2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule]
|
||||
c: /* empty. */ {};
|
||||
^^
|
||||
^~
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-fcaret -Wno-empty-rule 2.y], [0])
|
||||
@@ -170,10 +170,10 @@ exp:
|
||||
AT_BISON_CHECK([-fcaret one.y], [1], [],
|
||||
[[one.y:11.13-18: error: only one %empty allowed per rule
|
||||
%empty {} %empty
|
||||
^^^^^^
|
||||
^~~~~~
|
||||
one.y:11.3-8: previous declaration
|
||||
%empty {} %empty
|
||||
^^^^^^
|
||||
^~~~~~
|
||||
]])
|
||||
|
||||
AT_DATA_GRAMMAR([[two.y]],
|
||||
@@ -188,13 +188,13 @@ exp:
|
||||
AT_BISON_CHECK([-fcaret two.y], [1], [],
|
||||
[[two.y:11.7-12: error: %empty on non-empty rule
|
||||
'a' %empty {}
|
||||
^^^^^^
|
||||
^~~~~~
|
||||
two.y:12.3-8: error: %empty on non-empty rule
|
||||
| %empty 'a' {}
|
||||
^^^^^^
|
||||
^~~~~~
|
||||
two.y:13.3-8: error: %empty on non-empty rule
|
||||
| %empty {} {}
|
||||
^^^^^^
|
||||
^~~~~~
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
@@ -1514,16 +1514,16 @@ input.y:32.3-23: warning: unused value: $3 [-Wother]
|
||||
AT_BISON_CHECK([-fcaret -o input.c input.y], 0,,
|
||||
[[input.y:24.57-59: warning: useless %destructor for type <*> [-Wother]
|
||||
%printer { #error "<*> printer should not be used" } <*>
|
||||
^^^
|
||||
^~~
|
||||
input.y:24.57-59: warning: useless %printer for type <*> [-Wother]
|
||||
%printer { #error "<*> printer should not be used" } <*>
|
||||
^^^
|
||||
^~~
|
||||
input.y:33.3-23: warning: unset value: $$ [-Wother]
|
||||
{ @$ = 4; } // Only used.
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
^~~~~~~~~~~~~~~~~~~~~
|
||||
input.y:32.3-23: warning: unused value: $3 [-Wother]
|
||||
{ USE ($$); @$ = 3; } // Only set.
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
^~~~~~~~~~~~~~~~~~~~~
|
||||
]])
|
||||
|
||||
AT_COMPILE([input])
|
||||
|
||||
Reference in New Issue
Block a user