[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/12] diagnostics: prefer ^~~~ to ^^^^ to underline code
From: |
Akim Demaille |
Subject: |
[PATCH 04/12] diagnostics: prefer ^~~~ to ^^^^ to underline code |
Date: |
Sun, 13 Jan 2019 15:23:59 +0100 |
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.
---
src/location.c | 2 +-
tests/actions.at | 24 ++---
tests/c++.at | 6 +-
tests/conflicts.at | 12 +--
tests/input.at | 256 ++++++++++++++++++++++----------------------
tests/named-refs.at | 96 ++++++++---------
tests/reduce.at | 30 +++---
tests/regression.at | 4 +-
8 files changed, 215 insertions(+), 215 deletions(-)
diff --git a/src/location.c b/src/location.c
index 6d963264..4ec12a70 100644
--- a/src/location.c
+++ b/src/location.c
@@ -209,7 +209,7 @@ location_caret (location loc, FILE *out)
/* Print the carets (at least one), with the same indent as above.*/
fprintf (out, " %*s", loc.start.column - 1, "");
for (i = loc.start.column; i == loc.start.column || i < len; ++i)
- putc ('^', out);
+ putc (i == loc.start.column ? '^' : '~', out);
}
putc ('\n', out);
}
diff --git a/tests/actions.at b/tests/actions.at
index 3e942f82..787435e3 100644
--- a/tests/actions.at
+++ b/tests/actions.at
@@ -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])
diff --git a/tests/c++.at b/tests/c++.at
index 34ec13fb..215c032c 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -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
diff --git a/tests/conflicts.at b/tests/conflicts.at
index 1a9b658d..93f64952 100644
--- a/tests/conflicts.at
+++ b/tests/conflicts.at
@@ -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
diff --git a/tests/input.at b/tests/input.at
index 5d7ea7f6..c7042049 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -146,16 +146,16 @@ exp: "number";
AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [],
[[input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
%nterm exp
- ^^^^^^
+ ^~~~~~
input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals
[-Wyacc]
%token NUM 0x40 "number"
- ^^^^
+ ^~~~
input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc]
%token NUM 0x40 "number"
- ^^^^^^^^
+ ^~~~~~~~
input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc]
exp: "number";
- ^^^^^^^^
+ ^~~~~~~~
]])
AT_CLEANUP
@@ -180,16 +180,16 @@ b: %empty { $$ = 42; };
AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [],
[[input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc]
%destructor {} <int>
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc]
%printer {} <int>
- ^^^^^^^^
+ ^~~~~~~~
input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions
[-Wyacc]
a: <int>{ $$ = 42; } { $$ = $1; };
- ^^^^^^^^^^^^
+ ^~~~~~~~~~~~
input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc]
b: %empty { $$ = 42; };
- ^^^^^^
+ ^~~~~~
]])
AT_CLEANUP
@@ -219,25 +219,25 @@ fact: "number";
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.13-24: error: nonterminals cannot be given a string alias
%nterm expr "expression";
- ^^^^^^^^^^^^
+ ^~~~~~~~~~~~
input.y:2.13-15: error: nonterminals cannot be given an explicit number
%nterm term 123;
- ^^^
+ ^~~
input.y:3.13-15: error: nonterminals cannot be given an explicit number
%nterm fact 124 "factor";
- ^^^
+ ^~~
input.y:3.17-24: error: nonterminals cannot be given a string alias
%nterm fact 124 "factor";
- ^^^^^^^^
+ ^~~~~~~~
input.y:4.8-10: error: character literals cannot be nonterminals
%nterm '+' '*';
- ^^^
+ ^~~
input.y:5.8-15: error: syntax error, unexpected string, expecting char or
identifier or <tag>
%nterm "number";
- ^^^^^^^^
+ ^~~~~~~~
input.y:6.8-13: error: syntax error, unexpected string, expecting char or
identifier or <tag>
%token "tok1" 1;
- ^^^^^^
+ ^~~~~~
input.y:7.14: error: syntax error, unexpected integer
%left "tok2" 2;
^
@@ -364,10 +364,10 @@ exp: %empty { @$ = @1 ; };
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.20-21: error: integer out of range: '$1'
exp: %empty { $$ = $1 ; };
- ^^
+ ^~
input.y:3.20-21: error: integer out of range: '@1'
exp: %empty { @$ = @1 ; };
- ^^
+ ^~
]])
AT_CLEANUP
@@ -393,19 +393,19 @@ exp: foo { $$; } foo { $2; } foo
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:5.12-13: error: $$ for the midrule at $2 of 'exp' has no declared
type
exp: foo { $$; } foo { $2; } foo
- ^^
+ ^~
input.y:5.24-25: error: $2 of 'exp' has no declared type
exp: foo { $$; } foo { $2; } foo
- ^^
+ ^~
input.y:5.6-32: warning: type clash on default action: <bar> != <> [-Wother]
exp: foo { $$; } foo { $2; } foo
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.6-8: warning: type clash on default action: <bar> != <> [-Wother]
| foo
- ^^^
+ ^~~
input.y:7.6-11: warning: empty rule for typed nonterminal, and no action
[-Wother]
| %empty
- ^^^^^^
+ ^~~~~~
]])
AT_CLEANUP
@@ -464,133 +464,133 @@ AT_BISON_CHECK(m4_ifval([$2],
[--warnings=midrule-values ])[-fcaret input.y],
[0], [],
[[input.y:12.10-32: warning: unset value: $][$ [-Wother]
a: INT | INT { } INT { } INT { };
- ^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $][1 [-Wother]
a: INT | INT { } INT { } INT { };
- ^^^
+ ^~~
input.y:12.18-20: warning: unused value: $][3 [-Wother]
a: INT | INT { } INT { } INT { };
- ^^^
+ ^~~
input.y:12.26-28: warning: unused value: $][5 [-Wother]
a: INT | INT { } INT { } INT { };
- ^^^
+ ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action
[-Wother]
b: INT | %empty;
- ^^^^^^
+ ^~~~~~
]]m4_ifval([$2], [[[input.y:14.14-20: warning: unset value: $][$
[-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
- ^^^^^^^
+ ^~~~~~~
input.y:14.26-41: warning: unset value: $][$ [-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
- ^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~
]]])[[input.y:14.10-62: warning: unset value: $][$ [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $][3 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
- ^^^
+ ^~~
input.y:14.43-45: warning: unused value: $][5 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:15.14-16: warning: unset value: $][$
[-Wmidrule-values]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
- ^^^
+ ^~~
]]])[[input.y:15.10-49: warning: unset value: $][$ [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $][3 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
- ^^^
+ ^~~
input.y:15.30-32: warning: unused value: $][5 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; };
- ^^^
+ ^~~
input.y:16.10-37: warning: unset value: $][$ [-Wother]
e: INT | INT { } INT { } INT { $][1; };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $][3 [-Wother]
e: INT | INT { } INT { } INT { $][1; };
- ^^^
+ ^~~
input.y:16.27-29: warning: unused value: $][5 [-Wother]
e: INT | INT { } INT { } INT { $][1; };
- ^^^
+ ^~~
input.y:18.10-58: warning: unset value: $][$ [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $][1 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:18.14-29: warning: unused value: $][2
[-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~
]]])[[input.y:18.31-33: warning: unused value: $][3 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:18.35-50: warning: unused value: $][4
[-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~
]]])[[input.y:18.52-54: warning: unused value: $][5 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
- ^^^
+ ^~~
input.y:19.10-72: warning: unset value: $][$ [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $][1 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
- ^^^
+ ^~~
input.y:19.31-33: warning: unused value: $][3 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:19.35-64: warning: unused value: $][4
[-Wmidrule-values]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]])[[input.y:19.66-68: warning: unused value: $][5 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:21.18-37: warning: unused value: $][3
[-Wmidrule-values]
j: INT | INT INT { $<integer>$ = 1; } { $][$ = $][1 + $][2; };
- ^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~
]]])[[input.y:22.10-68: warning: unset value: $][$ [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $][1 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
- ^^^
+ ^~~
input.y:22.14-16: warning: unused value: $][2 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
- ^^^
+ ^~~
]]m4_ifval([$2], [[[input.y:22.35-64: warning: unused value: $][4
[-Wmidrule-values]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]])[[input.y:25.23-25: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.40-42: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.10-50: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $][1 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.23-25: warning: unused value: $][2 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.27-29: warning: unused value: $][3 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.40-42: warning: unused value: $][4 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:25.44-46: warning: unused value: $][5 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { };
- ^^^
+ ^~~
input.y:26.23-25: warning: unset value: $][$ [-Wother]
o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 +
$][4 + $][5; };
- ^^^
+ ^~~
input.y:26.40-42: warning: unset value: $][$ [-Wother]
o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 +
$][4 + $][5; };
- ^^^
+ ^~~
]])
])
@@ -633,19 +633,19 @@ BAR:
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.8-10: error: symbol FOO redeclared as a nonterminal
%nterm FOO BAR
- ^^^
+ ^~~
input.y:1.8-10: previous definition
%token FOO
- ^^^
+ ^~~
input.y:3.8-10: error: symbol BAR redeclared as a token
%token BAR
- ^^^
+ ^~~
input.y:2.12-14: previous definition
%nterm FOO BAR
- ^^^
+ ^~~
input.y:5.1-3: error: rule given for FOO, which is a token
FOO: BAR
- ^^^
+ ^~~
]])
AT_CLEANUP
@@ -678,40 +678,40 @@ start: %empty;
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <> <>
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <>
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:2.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <> <>
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration
%printer { print ($$); } <> <>
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:4.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <>
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <>
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:5.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <>
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration
%printer { print ($$); } <> <>
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:11.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <>;
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <>
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
input.y:12.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <>;
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration
%printer { print ($$); } <> <>
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
]])
])
@@ -781,16 +781,16 @@ exp: bar;
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.16-18: error: symbol bar is used, but is not defined as a token
and has no rules
%destructor {} bar
- ^^^
+ ^~~
input.y:1.17-19: warning: symbol baz is used, but is not defined as a token
and has no rules [-Wother]
%printer {} foo baz
- ^^^
+ ^~~
input.y:1.13-15: warning: symbol foo is used, but is not defined as a token
and has no rules [-Wother]
%printer {} foo baz
- ^^^
+ ^~~
input.y:3.13-15: warning: symbol qux is used, but is not defined as a token
and has no rules [-Wother]
%type <foo> qux
- ^^^
+ ^~~
]])
AT_CLEANUP
@@ -910,13 +910,13 @@ tagged: { } ;
AT_BISON_CHECK([-fcaret input.y], [0], [],
[[input.y:6.8-45: warning: unset value: $$ [-Wother]
start: end end tagged tagged { $<tag>1; $3; } ;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother]
start: end end tagged tagged { $<tag>1; $3; } ;
- ^^^
+ ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother]
end: { } ;
- ^^^
+ ^~~
]])
AT_DATA([[input.y]],
@@ -957,13 +957,13 @@ end: { } ;
AT_BISON_CHECK([-fcaret input.y], [0], [],
[[input.y:6.8-22: warning: unset value: $$ [-Wother]
start: end end { $1; } ;
- ^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother]
start: end end { $1; } ;
- ^^^
+ ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother]
end: { } ;
- ^^^
+ ^~~
]])
AT_CLEANUP
@@ -1014,13 +1014,13 @@ exp: FOO BAR;
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.17-21: warning: symbol "foo" used more than once as a literal
string [-Wother]
BAR 42 "foo"
- ^^^^^
+ ^~~~~
input.y:2.10-12: error: user token number 42 redeclaration for BAR
BAR 42 "foo"
- ^^^
+ ^~~
input.y:1.8-10: previous declaration for FOO
%token FOO 42 "foo"
- ^^^
+ ^~~
]])
AT_CLEANUP
@@ -1048,10 +1048,10 @@ exp: foo;
]],
[[input.y:3.7-11: error: %type redeclaration for foo
%type <baz> foo
- ^^^^^
+ ^~~~~
input.y:2.7-11: previous declaration
%type <bar> "foo"
- ^^^^^
+ ^~~~~
]])
AT_TEST([[%token foo "foo"
@@ -1062,10 +1062,10 @@ exp: foo;
]],
[[input.y:3.10-14: error: %printer redeclaration for foo
%printer {baz} foo
- ^^^^^
+ ^~~~~
input.y:2.10-14: previous declaration
%printer {bar} "foo"
- ^^^^^
+ ^~~~~
]])
AT_TEST([[%token foo "foo"
@@ -1076,10 +1076,10 @@ exp: foo;
]],
[[input.y:3.13-17: error: %destructor redeclaration for foo
%destructor {baz} foo
- ^^^^^
+ ^~~~~
input.y:2.13-17: previous declaration
%destructor {bar} "foo"
- ^^^^^
+ ^~~~~
]])
AT_TEST([[%token foo "foo"
@@ -1090,10 +1090,10 @@ exp: foo;
]],
[[input.y:3.1-5: error: %left redeclaration for foo
%left foo
- ^^^^^
+ ^~~~~
input.y:2.1-5: previous declaration
%left "foo"
- ^^^^^
+ ^~~~~
]])
# This time, declare the alias after its use.
@@ -1107,10 +1107,10 @@ exp: foo;
]],
[[input.y:2.1-5: error: %left redeclaration for foo
%left foo
- ^^^^^
+ ^~~~~
input.y:1.1-5: previous declaration
%left "foo"
- ^^^^^
+ ^~~~~
]])
# Printer.
@@ -1122,10 +1122,10 @@ exp: foo;
]],
[[input.y:2.10-11: error: %printer redeclaration for foo
%printer {} foo
- ^^
+ ^~
input.y:1.10-11: previous declaration
%printer {} "foo"
- ^^
+ ^~
]])
# Destructor.
@@ -1137,10 +1137,10 @@ exp: foo;
]],
[[input.y:2.13-14: error: %destructor redeclaration for foo
%destructor {} foo
- ^^
+ ^~
input.y:1.13-14: previous declaration
%destructor {} "foo"
- ^^
+ ^~
]])
m4_popdef([AT_TEST])
@@ -1170,7 +1170,7 @@ AT_DATA([input.y],
AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.1-2: error: syntax error, unexpected {...}
{}
- ^^
+ ^~
]])
@@ -1513,19 +1513,19 @@ start: %empty;
AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [],
[[input.y:1.10-2.0: error: missing '"' at end of line
%token A "a
- ^^
+ ^~
input.y:4.10-5.0: error: missing "'" at end of line
%token C '1
- ^^
+ ^~
input.y:14.11-15.0: error: missing "'" at end of line
%type <f> 'a
- ^^
+ ^~
input.y:16.11-17.0: error: missing '"' at end of line
%type <f> "a
- ^^
+ ^~
input.y:19.13-20.0: error: missing '}' at end of file
%destructor { free ($$)
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
input.y:20.1: error: syntax error, unexpected end of file
]])
@@ -1809,7 +1809,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret -Dvar=cmd-d input-dg.y]], [[1]], [],
[[input-dg.y:1.9-11: error: %define variable 'var' redefined
%define var "gram"
- ^^^
+ ^~~
<command line>:3: previous definition
]])
@@ -1931,7 +1931,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:1.9-28: error: invalid value for %define variable
'lr.default-reduction': 'bogus'
%define lr.default-reduction bogus
- ^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~
input.y:1.9-28: accepted value: 'most'
input.y:1.9-28: accepted value: 'consistent'
input.y:1.9-28: accepted value: 'accepting'
@@ -1946,7 +1946,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:1.9-21: error: invalid value for %define variable 'api.push-pull':
'neither'
%define api.push-pull neither
- ^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~
input.y:1.9-21: accepted value: 'pull'
input.y:1.9-21: accepted value: 'push'
input.y:1.9-21: accepted value: 'both'
@@ -1972,7 +1972,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:3.9-25: error: %define variable 'api.location.file' requires 'none'
or '"..."' values
%define api.location.file {bogus}
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
]])
AT_CLEANUP
@@ -1998,25 +1998,25 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [1], [],
[[input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull
both' [-Wdeprecated]
%define api.push_pull both
- ^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~
input.y:2.9-34: warning: deprecated directive, use '%define
lr.keep-unreachable-state maybe' [-Wdeprecated]
%define lr.keep_unreachable_states maybe
- ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:3.9-17: warning: deprecated directive, use '%define api.namespace
{foo}' [-Wdeprecated]
%define namespace "foo"
- ^^^^^^^^^
+ ^~~~~~~~~
input.y:4.9-21: error: %define variable 'api.namespace' redefined
%define api.namespace {foo}
- ^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~
input.y:3.9-17: previous definition
%define namespace "foo"
- ^^^^^^^^^
+ ^~~~~~~~~
input.y:5.9-15: warning: deprecated directive, use '%define api.value.type
variant' [-Wdeprecated]
%define variant
- ^^^^^^^
+ ^~~~~~~
input.y:6.9-25: warning: deprecated directive, use '%define api.parser.class
{parser}' [-Wdeprecated]
%define parser_class_name {parser}
- ^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~
]])
AT_CLEANUP
@@ -2129,7 +2129,7 @@ AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y ||
exit 77]])
AT_BISON_CHECK([-fcaret empty.y], [1], [],
[[empty.y:2.8-9: warning: empty character literal [-Wother]
start: '';
- ^^
+ ^~
empty.y:3.8-4.0: error: missing "'" at end of line
start: '
^
@@ -2615,7 +2615,7 @@ exp: <int> {}
AT_BISON_CHECK([[-fcaret input.y]], [[0]], [[]],
[[input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother]
exp: <int> {}
- ^^^^^^^^
+ ^~~~~~~~
]])
AT_CLEANUP
diff --git a/tests/named-refs.at b/tests/named-refs.at
index 6ebf4233..f350dcb0 100644
--- a/tests/named-refs.at
+++ b/tests/named-refs.at
@@ -254,16 +254,16 @@ exp:
AT_BISON_CHECK([-fcaret -o test.c test.y], 1, [],
[[test.y:52.51-60: error: invalid reference: '$<ival>lo9'
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
- ^^^^^^^^^^
+ ^~~~~~~~~~
test.y:52.3-68: symbol not found in production: lo9
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:53.51-60: warning: misleading reference: '$<ival>exp' [-Wother]
| exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; }
- ^^^^^^^^^^
+ ^~~~~~~~~~
test.y:44.1-3: refers to: $exp at $$
exp:
- ^^^
+ ^~~
test.y:53.7: possibly meant: $x, hiding $exp at $1
| exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; }
^
@@ -272,19 +272,19 @@ test.y:53.41: possibly meant: $r, hiding $exp at $4
^
test.y:54.51-52: error: $l of 'exp' has no declared type
| exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; }
- ^^
+ ^~
test.y:57.40-43: error: invalid reference: '$r12'
| exp[l] '^' exp[r] { $$ = power ($l, $r12); }
- ^^^^
+ ^~~~
test.y:57.3-47: symbol not found in production: r12
| exp[l] '^' exp[r] { $$ = power ($l, $r12); }
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:58.29-33: error: invalid reference: '$expo'
| '(' exp ')' { $$ = $expo; }
- ^^^^^
+ ^~~~~
test.y:58.3-46: symbol not found in production: expo
| '(' exp ')' { $$ = $expo; }
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]])
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
@@ -423,121 +423,121 @@ test.y:45.41-46: possibly meant: $[then-a].f at $4
AT_BISON_CHECK([-fcaret -o test.c test.y], 1, [],
[[test.y:24.36-41: error: invalid reference: '$cond1'
{ $if_stmt1 = new IfStmt($cond1, $then.f1, $else); };
- ^^^^^^
+ ^~~~~~
test.y:23.11-24.62: symbol not found in production: cond1
if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:26.43-53: error: invalid reference: '$stmt.field'
{ $if_stmt2 = new IfStmt($cond, $stmt.field, 0); };
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
test.y:25.11-26.60: symbol not found in production: stmt
if_stmt2: IF expr[cond] THEN stmt[then] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:25.35-38: possibly meant: $then.field, hiding $stmt.field at $4
if_stmt2: IF expr[cond] THEN stmt[then] FI
- ^^^^
+ ^~~~
test.y:28.43-52: error: invalid reference: '$stmt.list'
{ $if_stmt3 = new IfStmt($cond, $stmt.list, 0); };
- ^^^^^^^^^^
+ ^~~~~~~~~~
test.y:27.11-28.59: symbol not found in production: stmt
if_stmt3: IF expr[cond] THEN stmt.list FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:27.30-38: possibly meant: $[stmt.list] at $4
if_stmt3: IF expr[cond] THEN stmt.list FI
- ^^^^^^^^^
+ ^~~~~~~~~
test.y:30.43-46: error: ambiguous reference: '$xyz'
{ $if_stmt4 = new IfStmt($cond, $xyz, $cond); };
- ^^^^
+ ^~~~
test.y:29.35-37: refers to: $xyz at $4
if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
- ^^^
+ ^~~
test.y:29.50-52: refers to: $xyz at $6
if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
- ^^^
+ ^~~
test.y:32.43-52: error: invalid reference: '$stmt.list'
{ $if_stmt5 = new IfStmt($cond, $stmt.list, $else); };
- ^^^^^^^^^^
+ ^~~~~~~~~~
test.y:31.11-32.63: symbol not found in production: stmt
if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:31.40-43: possibly meant: $then, hiding $[stmt.list] at $4
if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:31.61-64: possibly meant: $else, hiding $[stmt.list] at $6
if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:34.43-58: error: invalid reference: '$stmt.list.field'
{ $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); };
- ^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~
test.y:33.11-34.69: symbol not found in production: stmt
if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:33.40-43: possibly meant: $then.field, hiding $[stmt.list].field at
$4
if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:33.61-64: possibly meant: $else.field, hiding $[stmt.list].field at
$6
if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:36.43-54: error: invalid reference: '$[stmt.list]'
{ $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); };
- ^^^^^^^^^^^^
+ ^~~~~~~~~~~~
test.y:35.11-36.71: symbol not found in production: stmt.list
if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:35.40-43: possibly meant: $then, hiding $[stmt.list] at $4
if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:35.61-64: possibly meant: $else, hiding $[stmt.list] at $6
if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^
+ ^~~~
test.y:38.43-49: error: invalid reference: '$then.1'
{ $if_stmt8 = new IfStmt($cond, $then.1, $else); };
- ^^^^^^^
+ ^~~~~~~
test.y:37.11-38.60: symbol not found in production: then
if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:37.40-45: possibly meant: $[then.1] at $4
if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
- ^^^^^^
+ ^~~~~~
test.y:40.43-55: error: invalid reference: '$then.1.field'
{ $if_stmt9 = new IfStmt($cond, $then.1.field, $else); };
- ^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~
test.y:39.11-40.66: symbol not found in production: then
if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:39.40-45: possibly meant: $[then.1].field at $4
if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
- ^^^^^^
+ ^~~~~~
test.y:42.44-50: error: invalid reference: '$stmt.x'
{ $if_stmt10 = new IfStmt($cond, $stmt.x, 0); };
- ^^^^^^^
+ ^~~~~~~
test.y:41.12-42.57: symbol not found in production: stmt
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:41.36-41: possibly meant: $[stmt.x].x, hiding $stmt.x at $4
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
- ^^^^^^
+ ^~~~~~
test.y:41.36-41: possibly meant: $[stmt.x] at $4
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
- ^^^^^^
+ ^~~~~~
test.y:44.13-22: error: invalid reference: '$if-stmt-a'
{ $if-stmt-a = new IfStmt($cond, $then, $else); };
- ^^^^^^^^^^
+ ^~~~~~~~~~
test.y:43.12-44.59: symbol not found in production: if
if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:43.1-9: possibly meant: $[if-stmt-a] at $$
if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
- ^^^^^^^^^
+ ^~~~~~~~~
test.y:46.46-54: error: invalid reference: '$then-a.f'
{ $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); };
- ^^^^^^^^^
+ ^~~~~~~~~
test.y:45.12-46.65: symbol not found in production: then
if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:45.41-46: possibly meant: $[then-a].f at $4
if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
- ^^^^^^
+ ^~~~~~
]])
AT_CLEANUP
diff --git a/tests/reduce.at b/tests/reduce.at
index d10d89f1..805b89d2 100644
--- a/tests/reduce.at
+++ b/tests/reduce.at
@@ -134,31 +134,31 @@ AT_BISON_CHECK([[-fcaret input.y]], 0, [],
input.y: warning: 9 rules useless in grammar [-Wother]
input.y:6.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
useless1: '1';
- ^^^^^^^^
+ ^~~~~~~~
input.y:7.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
useless2: '2';
- ^^^^^^^^
+ ^~~~~~~~
input.y:8.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
useless3: '3';
- ^^^^^^^^
+ ^~~~~~~~
input.y:9.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
useless4: '4';
- ^^^^^^^^
+ ^~~~~~~~
input.y:10.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
useless5: '5';
- ^^^^^^^^
+ ^~~~~~~~
input.y:11.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
useless6: '6';
- ^^^^^^^^
+ ^~~~~~~~
input.y:12.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
useless7: '7';
- ^^^^^^^^
+ ^~~~~~~~
input.y:13.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
useless8: '8';
- ^^^^^^^^
+ ^~~~~~~~
input.y:14.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
useless9: '9';
- ^^^^^^^^
+ ^~~~~~~~
]])
@@ -240,13 +240,13 @@ AT_BISON_CHECK([[-fcaret not-reduced.y]], 0, [],
not-reduced.y: warning: 3 rules useless in grammar [-Wother]
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
[-Wother]
not_reachable: useful { /* A not reachable action. */ }
- ^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~
not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive
[-Wother]
non_productive: non_productive useless_token
- ^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
| non_productive { /* A non productive action. */ }
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]])
AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' not-reduced.output]], 0,
@@ -319,13 +319,13 @@ AT_BISON_CHECK([[-fcaret input.y]], 0, [],
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother]
underivable: indirection;
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother]
indirection: underivable;
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
input.y:5.15-25: warning: rule useless in grammar [-Wother]
exp: useful | underivable;
- ^^^^^^^^^^^
+ ^~~~~~~~~~~
]])
AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' input.output]], 0,
diff --git a/tests/regression.at b/tests/regression.at
index 5fc03db7..b3173021 100644
--- a/tests/regression.at
+++ b/tests/regression.at
@@ -454,10 +454,10 @@ input.y:22.16-63: warning: symbol
"\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
- ^^^^^^^
+ ^~~~~~~
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!"
used more than once as a literal string [-Wother]
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]])
AT_COMPILE([input])
--
2.20.1
- [PATCH 00/12] RFC: fixits and --update, Akim Demaille, 2019/01/13
- [PATCH 12/12] diagnostics: add fixit support for duplicate removal, Akim Demaille, 2019/01/13
- [PATCH 01/12] diagnostics: style: avoid allocating memory when not needed, Akim Demaille, 2019/01/13
- [PATCH 02/12] diagnostics: improve them for %name-prefix, Akim Demaille, 2019/01/13
- [PATCH 09/12] diagnostics: avoid duplicate warnings for deprecated directives, Akim Demaille, 2019/01/13
- [PATCH 10/12] diagnostics: improve the accuracy for %error-verbose, Akim Demaille, 2019/01/13
- [PATCH 06/12] diagnostics: keep the fixits, Akim Demaille, 2019/01/13
- [PATCH 04/12] diagnostics: prefer ^~~~ to ^^^^ to underline code,
Akim Demaille <=
- [PATCH 05/12] diagnostics: add -ffixit support for deprecated features, Akim Demaille, 2019/01/13
- [PATCH 08/12] diagnostics: update the grammar file, Akim Demaille, 2019/01/13
- [PATCH 07/12] diagnostics: improve accuracy for deprecated %define variables, Akim Demaille, 2019/01/13