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

@@ -209,7 +209,7 @@ location_caret (location loc, FILE *out)
/* Print the carets (at least one), with the same indent as above.*/ /* Print the carets (at least one), with the same indent as above.*/
fprintf (out, " %*s", loc.start.column - 1, ""); fprintf (out, " %*s", loc.start.column - 1, "");
for (i = loc.start.column; i == loc.start.column || i < len; ++i) for (i = loc.start.column; i == loc.start.column || i < len; ++i)
putc ('^', out); putc (i == loc.start.column ? '^' : '~', out);
} }
putc ('\n', out); putc ('\n', out);
} }

View File

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

View File

@@ -249,13 +249,13 @@ exp:
AT_BISON_CHECK([[-fcaret input.yy]], [0], [], AT_BISON_CHECK([[-fcaret input.yy]], [0], [],
[[input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove [-Wother] [[input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove [-Wother]
| "twice" exp { $$ = $2 + $2; } | "twice" exp { $$ = $2 + $2; }
^^ ^~
input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother] input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother]
| "thrice" exp[val] { $$ = $2 + $val + $2; } | "thrice" exp[val] { $$ = $2 + $val + $2; }
^^^^ ^~~~
input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove [-Wother] input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove [-Wother]
| "thrice" exp[val] { $$ = $2 + $val + $2; } | "thrice" exp[val] { $$ = $2 + $val + $2; }
^^ ^~
]]) ]])
AT_BISON_OPTION_POPDEFS AT_BISON_OPTION_POPDEFS

View File

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

View File

@@ -146,16 +146,16 @@ exp: "number";
AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [], AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [],
[[input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc] [[input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
%nterm exp %nterm exp
^^^^^^ ^~~~~~
input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc] input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc]
%token NUM 0x40 "number" %token NUM 0x40 "number"
^^^^ ^~~~
input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc]
%token NUM 0x40 "number" %token NUM 0x40 "number"
^^^^^^^^ ^~~~~~~~
input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc]
exp: "number"; exp: "number";
^^^^^^^^ ^~~~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -180,16 +180,16 @@ b: %empty { $$ = 42; };
AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [], AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [],
[[input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] [[input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc]
%destructor {} <int> %destructor {} <int>
^^^^^^^^^^^ ^~~~~~~~~~~
input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc] input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc]
%printer {} <int> %printer {} <int>
^^^^^^^^ ^~~~~~~~
input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc]
a: <int>{ $$ = 42; } { $$ = $1; }; a: <int>{ $$ = 42; } { $$ = $1; };
^^^^^^^^^^^^ ^~~~~~~~~~~~
input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc] input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc]
b: %empty { $$ = 42; }; b: %empty { $$ = 42; };
^^^^^^ ^~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -219,25 +219,25 @@ fact: "number";
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.13-24: error: nonterminals cannot be given a string alias [[input.y:1.13-24: error: nonterminals cannot be given a string alias
%nterm expr "expression"; %nterm expr "expression";
^^^^^^^^^^^^ ^~~~~~~~~~~~
input.y:2.13-15: error: nonterminals cannot be given an explicit number input.y:2.13-15: error: nonterminals cannot be given an explicit number
%nterm term 123; %nterm term 123;
^^^ ^~~
input.y:3.13-15: error: nonterminals cannot be given an explicit number input.y:3.13-15: error: nonterminals cannot be given an explicit number
%nterm fact 124 "factor"; %nterm fact 124 "factor";
^^^ ^~~
input.y:3.17-24: error: nonterminals cannot be given a string alias input.y:3.17-24: error: nonterminals cannot be given a string alias
%nterm fact 124 "factor"; %nterm fact 124 "factor";
^^^^^^^^ ^~~~~~~~
input.y:4.8-10: error: character literals cannot be nonterminals input.y:4.8-10: error: character literals cannot be nonterminals
%nterm '+' '*'; %nterm '+' '*';
^^^ ^~~
input.y:5.8-15: error: syntax error, unexpected string, expecting char or identifier or <tag> input.y:5.8-15: error: syntax error, unexpected string, expecting char or identifier or <tag>
%nterm "number"; %nterm "number";
^^^^^^^^ ^~~~~~~~
input.y:6.8-13: error: syntax error, unexpected string, expecting char or identifier or <tag> input.y:6.8-13: error: syntax error, unexpected string, expecting char or identifier or <tag>
%token "tok1" 1; %token "tok1" 1;
^^^^^^ ^~~~~~
input.y:7.14: error: syntax error, unexpected integer input.y:7.14: error: syntax error, unexpected integer
%left "tok2" 2; %left "tok2" 2;
^ ^
@@ -364,10 +364,10 @@ exp: %empty { @$ = @1 ; };
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.20-21: error: integer out of range: '$1' [[input.y:2.20-21: error: integer out of range: '$1'
exp: %empty { $$ = $1 ; }; exp: %empty { $$ = $1 ; };
^^ ^~
input.y:3.20-21: error: integer out of range: '@1' input.y:3.20-21: error: integer out of range: '@1'
exp: %empty { @$ = @1 ; }; exp: %empty { @$ = @1 ; };
^^ ^~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -393,19 +393,19 @@ exp: foo { $$; } foo { $2; } foo
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:5.12-13: error: $$ for the midrule at $2 of 'exp' has no declared type [[input.y:5.12-13: error: $$ for the midrule at $2 of 'exp' has no declared type
exp: foo { $$; } foo { $2; } foo exp: foo { $$; } foo { $2; } foo
^^ ^~
input.y:5.24-25: error: $2 of 'exp' has no declared type input.y:5.24-25: error: $2 of 'exp' has no declared type
exp: foo { $$; } foo { $2; } foo exp: foo { $$; } foo { $2; } foo
^^ ^~
input.y:5.6-32: warning: type clash on default action: <bar> != <> [-Wother] input.y:5.6-32: warning: type clash on default action: <bar> != <> [-Wother]
exp: foo { $$; } foo { $2; } foo exp: foo { $$; } foo { $2; } foo
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.6-8: warning: type clash on default action: <bar> != <> [-Wother] input.y:6.6-8: warning: type clash on default action: <bar> != <> [-Wother]
| foo | foo
^^^ ^~~
input.y:7.6-11: warning: empty rule for typed nonterminal, and no action [-Wother] input.y:7.6-11: warning: empty rule for typed nonterminal, and no action [-Wother]
| %empty | %empty
^^^^^^ ^~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -464,133 +464,133 @@ AT_BISON_CHECK(m4_ifval([$2], [--warnings=midrule-values ])[-fcaret input.y],
[0], [], [0], [],
[[input.y:12.10-32: warning: unset value: $][$ [-Wother] [[input.y:12.10-32: warning: unset value: $][$ [-Wother]
a: INT | INT { } INT { } INT { }; a: INT | INT { } INT { } INT { };
^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $][1 [-Wother] input.y:12.10-12: warning: unused value: $][1 [-Wother]
a: INT | INT { } INT { } INT { }; a: INT | INT { } INT { } INT { };
^^^ ^~~
input.y:12.18-20: warning: unused value: $][3 [-Wother] input.y:12.18-20: warning: unused value: $][3 [-Wother]
a: INT | INT { } INT { } INT { }; a: INT | INT { } INT { } INT { };
^^^ ^~~
input.y:12.26-28: warning: unused value: $][5 [-Wother] input.y:12.26-28: warning: unused value: $][5 [-Wother]
a: INT | INT { } INT { } INT { }; a: INT | INT { } INT { } INT { };
^^^ ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
b: INT | %empty; b: INT | %empty;
^^^^^^ ^~~~~~
]]m4_ifval([$2], [[[input.y:14.14-20: warning: unset value: $][$ [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:14.14-20: warning: unset value: $][$ [-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; }; c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^ ^~~~~~~
input.y:14.26-41: warning: unset value: $][$ [-Wmidrule-values] input.y:14.26-41: warning: unset value: $][$ [-Wmidrule-values]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; }; c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~
]]])[[input.y:14.10-62: warning: unset value: $][$ [-Wother] ]]])[[input.y:14.10-62: warning: unset value: $][$ [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; }; c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $][3 [-Wother] input.y:14.22-24: warning: unused value: $][3 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; }; c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^ ^~~
input.y:14.43-45: warning: unused value: $][5 [-Wother] input.y:14.43-45: warning: unused value: $][5 [-Wother]
c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; }; c: INT | INT { $][1; } INT { $<integer>2; } INT { $<integer>4; };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:15.14-16: warning: unset value: $][$ [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:15.14-16: warning: unset value: $][$ [-Wmidrule-values]
d: INT | INT { } INT { $][1; } INT { $<integer>2; }; d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^ ^~~
]]])[[input.y:15.10-49: warning: unset value: $][$ [-Wother] ]]])[[input.y:15.10-49: warning: unset value: $][$ [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; }; d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $][3 [-Wother] input.y:15.18-20: warning: unused value: $][3 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; }; d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^ ^~~
input.y:15.30-32: warning: unused value: $][5 [-Wother] input.y:15.30-32: warning: unused value: $][5 [-Wother]
d: INT | INT { } INT { $][1; } INT { $<integer>2; }; d: INT | INT { } INT { $][1; } INT { $<integer>2; };
^^^ ^~~
input.y:16.10-37: warning: unset value: $][$ [-Wother] input.y:16.10-37: warning: unset value: $][$ [-Wother]
e: INT | INT { } INT { } INT { $][1; }; e: INT | INT { } INT { } INT { $][1; };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $][3 [-Wother] input.y:16.18-20: warning: unused value: $][3 [-Wother]
e: INT | INT { } INT { } INT { $][1; }; e: INT | INT { } INT { } INT { $][1; };
^^^ ^~~
input.y:16.27-29: warning: unused value: $][5 [-Wother] input.y:16.27-29: warning: unused value: $][5 [-Wother]
e: INT | INT { } INT { } INT { $][1; }; e: INT | INT { } INT { } INT { $][1; };
^^^ ^~~
input.y:18.10-58: warning: unset value: $][$ [-Wother] input.y:18.10-58: warning: unset value: $][$ [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $][1 [-Wother] input.y:18.10-12: warning: unused value: $][1 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:18.14-29: warning: unused value: $][2 [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:18.14-29: warning: unused value: $][2 [-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~
]]])[[input.y:18.31-33: warning: unused value: $][3 [-Wother] ]]])[[input.y:18.31-33: warning: unused value: $][3 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:18.35-50: warning: unused value: $][4 [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:18.35-50: warning: unused value: $][4 [-Wmidrule-values]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~
]]])[[input.y:18.52-54: warning: unused value: $][5 [-Wother] ]]])[[input.y:18.52-54: warning: unused value: $][5 [-Wother]
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { }; g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
^^^ ^~~
input.y:19.10-72: warning: unset value: $][$ [-Wother] input.y:19.10-72: warning: unset value: $][$ [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { }; h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $][1 [-Wother] input.y:19.10-12: warning: unused value: $][1 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { }; h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^ ^~~
input.y:19.31-33: warning: unused value: $][3 [-Wother] input.y:19.31-33: warning: unused value: $][3 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { }; h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:19.35-64: warning: unused value: $][4 [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:19.35-64: warning: unused value: $][4 [-Wmidrule-values]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { }; h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]])[[input.y:19.66-68: warning: unused value: $][5 [-Wother] ]]])[[input.y:19.66-68: warning: unused value: $][5 [-Wother]
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { }; h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:21.18-37: warning: unused value: $][3 [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:21.18-37: warning: unused value: $][3 [-Wmidrule-values]
j: INT | INT INT { $<integer>$ = 1; } { $][$ = $][1 + $][2; }; j: INT | INT INT { $<integer>$ = 1; } { $][$ = $][1 + $][2; };
^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~
]]])[[input.y:22.10-68: warning: unset value: $][$ [-Wother] ]]])[[input.y:22.10-68: warning: unset value: $][$ [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { }; k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $][1 [-Wother] input.y:22.10-12: warning: unused value: $][1 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { }; k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^ ^~~
input.y:22.14-16: warning: unused value: $][2 [-Wother] input.y:22.14-16: warning: unused value: $][2 [-Wother]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { }; k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^ ^~~
]]m4_ifval([$2], [[[input.y:22.35-64: warning: unused value: $][4 [-Wmidrule-values] ]]m4_ifval([$2], [[[input.y:22.35-64: warning: unused value: $][4 [-Wmidrule-values]
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { }; k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]])[[input.y:25.23-25: warning: unset value: $][$ [-Wother] ]]])[[input.y:25.23-25: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.40-42: warning: unset value: $][$ [-Wother] input.y:25.40-42: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.10-50: warning: unset value: $][$ [-Wother] input.y:25.10-50: warning: unset value: $][$ [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $][1 [-Wother] input.y:25.10-12: warning: unused value: $][1 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.23-25: warning: unused value: $][2 [-Wother] input.y:25.23-25: warning: unused value: $][2 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.27-29: warning: unused value: $][3 [-Wother] input.y:25.27-29: warning: unused value: $][3 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.40-42: warning: unused value: $][4 [-Wother] input.y:25.40-42: warning: unused value: $][4 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:25.44-46: warning: unused value: $][5 [-Wother] input.y:25.44-46: warning: unused value: $][5 [-Wother]
n: INT | INT <integer>{ } INT <integer>{ } INT { }; n: INT | INT <integer>{ } INT <integer>{ } INT { };
^^^ ^~~
input.y:26.23-25: warning: unset value: $][$ [-Wother] input.y:26.23-25: warning: unset value: $][$ [-Wother]
o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; }; o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; };
^^^ ^~~
input.y:26.40-42: warning: unset value: $][$ [-Wother] input.y:26.40-42: warning: unset value: $][$ [-Wother]
o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; }; o: INT | INT <integer>{ } INT <integer>{ } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; };
^^^ ^~~
]]) ]])
]) ])
@@ -633,19 +633,19 @@ BAR:
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.8-10: error: symbol FOO redeclared as a nonterminal [[input.y:2.8-10: error: symbol FOO redeclared as a nonterminal
%nterm FOO BAR %nterm FOO BAR
^^^ ^~~
input.y:1.8-10: previous definition input.y:1.8-10: previous definition
%token FOO %token FOO
^^^ ^~~
input.y:3.8-10: error: symbol BAR redeclared as a token input.y:3.8-10: error: symbol BAR redeclared as a token
%token BAR %token BAR
^^^ ^~~
input.y:2.12-14: previous definition input.y:2.12-14: previous definition
%nterm FOO BAR %nterm FOO BAR
^^^ ^~~
input.y:5.1-3: error: rule given for FOO, which is a token input.y:5.1-3: error: rule given for FOO, which is a token
FOO: BAR FOO: BAR
^^^ ^~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -678,40 +678,40 @@ start: %empty;
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.13-29: error: %destructor redeclaration for <> [[input.y:1.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <> <> %destructor { destroy ($$); } <> <>
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <> %destructor { destroy ($$); } <> <>
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:2.10-24: error: %printer redeclaration for <> input.y:2.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <> <> %printer { print ($$); } <> <>
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration input.y:2.10-24: previous declaration
%printer { print ($$); } <> <> %printer { print ($$); } <> <>
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:4.13-29: error: %destructor redeclaration for <> input.y:4.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <> %destructor { destroy ($$); } <>
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <> %destructor { destroy ($$); } <> <>
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:5.10-24: error: %printer redeclaration for <> input.y:5.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <> %printer { print ($$); } <>
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration input.y:2.10-24: previous declaration
%printer { print ($$); } <> <> %printer { print ($$); } <> <>
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:11.13-29: error: %destructor redeclaration for <> input.y:11.13-29: error: %destructor redeclaration for <>
%destructor { destroy ($$); } <>; %destructor { destroy ($$); } <>;
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:1.13-29: previous declaration input.y:1.13-29: previous declaration
%destructor { destroy ($$); } <> <> %destructor { destroy ($$); } <> <>
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
input.y:12.10-24: error: %printer redeclaration for <> input.y:12.10-24: error: %printer redeclaration for <>
%printer { print ($$); } <>; %printer { print ($$); } <>;
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:2.10-24: previous declaration input.y:2.10-24: previous declaration
%printer { print ($$); } <> <> %printer { print ($$); } <> <>
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
]]) ]])
]) ])
@@ -781,16 +781,16 @@ exp: bar;
AT_BISON_CHECK([-fcaret input.y], [1], [], 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 [[input.y:2.16-18: error: symbol bar is used, but is not defined as a token and has no rules
%destructor {} bar %destructor {} bar
^^^ ^~~
input.y:1.17-19: warning: symbol baz is used, but is not defined as a token and has no rules [-Wother] 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 %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] 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 %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] 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 %type <foo> qux
^^^ ^~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -910,13 +910,13 @@ tagged: { } ;
AT_BISON_CHECK([-fcaret input.y], [0], [], AT_BISON_CHECK([-fcaret input.y], [0], [],
[[input.y:6.8-45: warning: unset value: $$ [-Wother] [[input.y:6.8-45: warning: unset value: $$ [-Wother]
start: end end tagged tagged { $<tag>1; $3; } ; start: end end tagged tagged { $<tag>1; $3; } ;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother] input.y:6.12-14: warning: unused value: $2 [-Wother]
start: end end tagged tagged { $<tag>1; $3; } ; start: end end tagged tagged { $<tag>1; $3; } ;
^^^ ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother] input.y:7.6-8: warning: unset value: $$ [-Wother]
end: { } ; end: { } ;
^^^ ^~~
]]) ]])
AT_DATA([[input.y]], AT_DATA([[input.y]],
@@ -957,13 +957,13 @@ end: { } ;
AT_BISON_CHECK([-fcaret input.y], [0], [], AT_BISON_CHECK([-fcaret input.y], [0], [],
[[input.y:6.8-22: warning: unset value: $$ [-Wother] [[input.y:6.8-22: warning: unset value: $$ [-Wother]
start: end end { $1; } ; start: end end { $1; } ;
^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother] input.y:6.12-14: warning: unused value: $2 [-Wother]
start: end end { $1; } ; start: end end { $1; } ;
^^^ ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother] input.y:7.6-8: warning: unset value: $$ [-Wother]
end: { } ; end: { } ;
^^^ ^~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -1014,13 +1014,13 @@ exp: FOO BAR;
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:2.17-21: warning: symbol "foo" used more than once as a literal string [-Wother] [[input.y:2.17-21: warning: symbol "foo" used more than once as a literal string [-Wother]
BAR 42 "foo" BAR 42 "foo"
^^^^^ ^~~~~
input.y:2.10-12: error: user token number 42 redeclaration for BAR input.y:2.10-12: error: user token number 42 redeclaration for BAR
BAR 42 "foo" BAR 42 "foo"
^^^ ^~~
input.y:1.8-10: previous declaration for FOO input.y:1.8-10: previous declaration for FOO
%token FOO 42 "foo" %token FOO 42 "foo"
^^^ ^~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -1048,10 +1048,10 @@ exp: foo;
]], ]],
[[input.y:3.7-11: error: %type redeclaration for foo [[input.y:3.7-11: error: %type redeclaration for foo
%type <baz> foo %type <baz> foo
^^^^^ ^~~~~
input.y:2.7-11: previous declaration input.y:2.7-11: previous declaration
%type <bar> "foo" %type <bar> "foo"
^^^^^ ^~~~~
]]) ]])
AT_TEST([[%token foo "foo" AT_TEST([[%token foo "foo"
@@ -1062,10 +1062,10 @@ exp: foo;
]], ]],
[[input.y:3.10-14: error: %printer redeclaration for foo [[input.y:3.10-14: error: %printer redeclaration for foo
%printer {baz} foo %printer {baz} foo
^^^^^ ^~~~~
input.y:2.10-14: previous declaration input.y:2.10-14: previous declaration
%printer {bar} "foo" %printer {bar} "foo"
^^^^^ ^~~~~
]]) ]])
AT_TEST([[%token foo "foo" AT_TEST([[%token foo "foo"
@@ -1076,10 +1076,10 @@ exp: foo;
]], ]],
[[input.y:3.13-17: error: %destructor redeclaration for foo [[input.y:3.13-17: error: %destructor redeclaration for foo
%destructor {baz} foo %destructor {baz} foo
^^^^^ ^~~~~
input.y:2.13-17: previous declaration input.y:2.13-17: previous declaration
%destructor {bar} "foo" %destructor {bar} "foo"
^^^^^ ^~~~~
]]) ]])
AT_TEST([[%token foo "foo" AT_TEST([[%token foo "foo"
@@ -1090,10 +1090,10 @@ exp: foo;
]], ]],
[[input.y:3.1-5: error: %left redeclaration for foo [[input.y:3.1-5: error: %left redeclaration for foo
%left foo %left foo
^^^^^ ^~~~~
input.y:2.1-5: previous declaration input.y:2.1-5: previous declaration
%left "foo" %left "foo"
^^^^^ ^~~~~
]]) ]])
# This time, declare the alias after its use. # This time, declare the alias after its use.
@@ -1107,10 +1107,10 @@ exp: foo;
]], ]],
[[input.y:2.1-5: error: %left redeclaration for foo [[input.y:2.1-5: error: %left redeclaration for foo
%left foo %left foo
^^^^^ ^~~~~
input.y:1.1-5: previous declaration input.y:1.1-5: previous declaration
%left "foo" %left "foo"
^^^^^ ^~~~~
]]) ]])
# Printer. # Printer.
@@ -1122,10 +1122,10 @@ exp: foo;
]], ]],
[[input.y:2.10-11: error: %printer redeclaration for foo [[input.y:2.10-11: error: %printer redeclaration for foo
%printer {} foo %printer {} foo
^^ ^~
input.y:1.10-11: previous declaration input.y:1.10-11: previous declaration
%printer {} "foo" %printer {} "foo"
^^ ^~
]]) ]])
# Destructor. # Destructor.
@@ -1137,10 +1137,10 @@ exp: foo;
]], ]],
[[input.y:2.13-14: error: %destructor redeclaration for foo [[input.y:2.13-14: error: %destructor redeclaration for foo
%destructor {} foo %destructor {} foo
^^ ^~
input.y:1.13-14: previous declaration input.y:1.13-14: previous declaration
%destructor {} "foo" %destructor {} "foo"
^^ ^~
]]) ]])
m4_popdef([AT_TEST]) m4_popdef([AT_TEST])
@@ -1170,7 +1170,7 @@ AT_DATA([input.y],
AT_BISON_CHECK([-fcaret input.y], [1], [], AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.1-2: error: syntax error, unexpected {...} [[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, [], AT_BISON_CHECK([-fcaret -o input.c input.y], 1, [],
[[input.y:1.10-2.0: error: missing '"' at end of line [[input.y:1.10-2.0: error: missing '"' at end of line
%token A "a %token A "a
^^ ^~
input.y:4.10-5.0: error: missing "'" at end of line input.y:4.10-5.0: error: missing "'" at end of line
%token C '1 %token C '1
^^ ^~
input.y:14.11-15.0: error: missing "'" at end of line input.y:14.11-15.0: error: missing "'" at end of line
%type <f> 'a %type <f> 'a
^^ ^~
input.y:16.11-17.0: error: missing '"' at end of line input.y:16.11-17.0: error: missing '"' at end of line
%type <f> "a %type <f> "a
^^ ^~
input.y:19.13-20.0: error: missing '}' at end of file input.y:19.13-20.0: error: missing '}' at end of file
%destructor { free ($$) %destructor { free ($$)
^^^^^^^^^^^ ^~~~~~~~~~~
input.y:20.1: error: syntax error, unexpected end of file 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]], [], AT_BISON_CHECK([[-fcaret -Dvar=cmd-d input-dg.y]], [[1]], [],
[[input-dg.y:1.9-11: error: %define variable 'var' redefined [[input-dg.y:1.9-11: error: %define variable 'var' redefined
%define var "gram" %define var "gram"
^^^ ^~~
<command line>:3: previous definition <command line>:3: previous definition
]]) ]])
@@ -1931,7 +1931,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]], AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:1.9-28: error: invalid value for %define variable 'lr.default-reduction': 'bogus' [[input.y:1.9-28: error: invalid value for %define variable 'lr.default-reduction': 'bogus'
%define lr.default-reduction bogus %define lr.default-reduction bogus
^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~
input.y:1.9-28: accepted value: 'most' input.y:1.9-28: accepted value: 'most'
input.y:1.9-28: accepted value: 'consistent' input.y:1.9-28: accepted value: 'consistent'
input.y:1.9-28: accepted value: 'accepting' input.y:1.9-28: accepted value: 'accepting'
@@ -1946,7 +1946,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]], AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither' [[input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
%define api.push-pull neither %define api.push-pull neither
^^^^^^^^^^^^^ ^~~~~~~~~~~~~
input.y:1.9-21: accepted value: 'pull' input.y:1.9-21: accepted value: 'pull'
input.y:1.9-21: accepted value: 'push' input.y:1.9-21: accepted value: 'push'
input.y:1.9-21: accepted value: 'both' input.y:1.9-21: accepted value: 'both'
@@ -1972,7 +1972,7 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]], AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
[[input.y:3.9-25: error: %define variable 'api.location.file' requires 'none' or '"..."' values [[input.y:3.9-25: error: %define variable 'api.location.file' requires 'none' or '"..."' values
%define api.location.file {bogus} %define api.location.file {bogus}
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -1998,25 +1998,25 @@ start: %empty;
AT_BISON_CHECK([[-fcaret input.y]], [1], [], AT_BISON_CHECK([[-fcaret input.y]], [1], [],
[[input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull both' [-Wdeprecated] [[input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull both' [-Wdeprecated]
%define api.push_pull both %define api.push_pull both
^^^^^^^^^^^^^ ^~~~~~~~~~~~~
input.y:2.9-34: warning: deprecated directive, use '%define lr.keep-unreachable-state maybe' [-Wdeprecated] input.y:2.9-34: warning: deprecated directive, use '%define lr.keep-unreachable-state maybe' [-Wdeprecated]
%define lr.keep_unreachable_states maybe %define lr.keep_unreachable_states maybe
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:3.9-17: warning: deprecated directive, use '%define api.namespace {foo}' [-Wdeprecated] input.y:3.9-17: warning: deprecated directive, use '%define api.namespace {foo}' [-Wdeprecated]
%define namespace "foo" %define namespace "foo"
^^^^^^^^^ ^~~~~~~~~
input.y:4.9-21: error: %define variable 'api.namespace' redefined input.y:4.9-21: error: %define variable 'api.namespace' redefined
%define api.namespace {foo} %define api.namespace {foo}
^^^^^^^^^^^^^ ^~~~~~~~~~~~~
input.y:3.9-17: previous definition input.y:3.9-17: previous definition
%define namespace "foo" %define namespace "foo"
^^^^^^^^^ ^~~~~~~~~
input.y:5.9-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated] input.y:5.9-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated]
%define variant %define variant
^^^^^^^ ^~~~~~~
input.y:6.9-25: warning: deprecated directive, use '%define api.parser.class {parser}' [-Wdeprecated] input.y:6.9-25: warning: deprecated directive, use '%define api.parser.class {parser}' [-Wdeprecated]
%define parser_class_name {parser} %define parser_class_name {parser}
^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP
@@ -2129,7 +2129,7 @@ AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y || exit 77]])
AT_BISON_CHECK([-fcaret empty.y], [1], [], AT_BISON_CHECK([-fcaret empty.y], [1], [],
[[empty.y:2.8-9: warning: empty character literal [-Wother] [[empty.y:2.8-9: warning: empty character literal [-Wother]
start: ''; start: '';
^^ ^~
empty.y:3.8-4.0: error: missing "'" at end of line empty.y:3.8-4.0: error: missing "'" at end of line
start: ' start: '
^ ^
@@ -2615,7 +2615,7 @@ exp: <int> {}
AT_BISON_CHECK([[-fcaret input.y]], [[0]], [[]], AT_BISON_CHECK([[-fcaret input.y]], [[0]], [[]],
[[input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother] [[input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother]
exp: <int> {} exp: <int> {}
^^^^^^^^ ^~~~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP

View File

@@ -254,16 +254,16 @@ exp:
AT_BISON_CHECK([-fcaret -o test.c test.y], 1, [], AT_BISON_CHECK([-fcaret -o test.c test.y], 1, [],
[[test.y:52.51-60: error: invalid reference: '$<ival>lo9' [[test.y:52.51-60: error: invalid reference: '$<ival>lo9'
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; } | exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
^^^^^^^^^^ ^~~~~~~~~~
test.y:52.3-68: symbol not found in production: lo9 test.y:52.3-68: symbol not found in production: lo9
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; } | exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:53.51-60: warning: misleading reference: '$<ival>exp' [-Wother] test.y:53.51-60: warning: misleading reference: '$<ival>exp' [-Wother]
| exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; } | exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; }
^^^^^^^^^^ ^~~~~~~~~~
test.y:44.1-3: refers to: $exp at $$ test.y:44.1-3: refers to: $exp at $$
exp: exp:
^^^ ^~~
test.y:53.7: possibly meant: $x, hiding $exp at $1 test.y:53.7: possibly meant: $x, hiding $exp at $1
| exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; } | 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 test.y:54.51-52: error: $l of 'exp' has no declared type
| exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; } | exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; }
^^ ^~
test.y:57.40-43: error: invalid reference: '$r12' test.y:57.40-43: error: invalid reference: '$r12'
| exp[l] '^' exp[r] { $$ = power ($l, $r12); } | exp[l] '^' exp[r] { $$ = power ($l, $r12); }
^^^^ ^~~~
test.y:57.3-47: symbol not found in production: r12 test.y:57.3-47: symbol not found in production: r12
| exp[l] '^' exp[r] { $$ = power ($l, $r12); } | exp[l] '^' exp[r] { $$ = power ($l, $r12); }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:58.29-33: error: invalid reference: '$expo' test.y:58.29-33: error: invalid reference: '$expo'
| '(' exp ')' { $$ = $expo; } | '(' exp ')' { $$ = $expo; }
^^^^^ ^~~~~
test.y:58.3-46: symbol not found in production: expo test.y:58.3-46: symbol not found in production: expo
| '(' exp ')' { $$ = $expo; } | '(' exp ')' { $$ = $expo; }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]) ]])
AT_BISON_OPTION_POPDEFS AT_BISON_OPTION_POPDEFS
AT_CLEANUP 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, [], AT_BISON_CHECK([-fcaret -o test.c test.y], 1, [],
[[test.y:24.36-41: error: invalid reference: '$cond1' [[test.y:24.36-41: error: invalid reference: '$cond1'
{ $if_stmt1 = new IfStmt($cond1, $then.f1, $else); }; { $if_stmt1 = new IfStmt($cond1, $then.f1, $else); };
^^^^^^ ^~~~~~
test.y:23.11-24.62: symbol not found in production: cond1 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 if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:26.43-53: error: invalid reference: '$stmt.field' test.y:26.43-53: error: invalid reference: '$stmt.field'
{ $if_stmt2 = new IfStmt($cond, $stmt.field, 0); }; { $if_stmt2 = new IfStmt($cond, $stmt.field, 0); };
^^^^^^^^^^^ ^~~~~~~~~~~
test.y:25.11-26.60: symbol not found in production: stmt test.y:25.11-26.60: symbol not found in production: stmt
if_stmt2: IF expr[cond] THEN stmt[then] FI if_stmt2: IF expr[cond] THEN stmt[then] FI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:25.35-38: possibly meant: $then.field, hiding $stmt.field at $4 test.y:25.35-38: possibly meant: $then.field, hiding $stmt.field at $4
if_stmt2: IF expr[cond] THEN stmt[then] FI if_stmt2: IF expr[cond] THEN stmt[then] FI
^^^^ ^~~~
test.y:28.43-52: error: invalid reference: '$stmt.list' test.y:28.43-52: error: invalid reference: '$stmt.list'
{ $if_stmt3 = new IfStmt($cond, $stmt.list, 0); }; { $if_stmt3 = new IfStmt($cond, $stmt.list, 0); };
^^^^^^^^^^ ^~~~~~~~~~
test.y:27.11-28.59: symbol not found in production: stmt test.y:27.11-28.59: symbol not found in production: stmt
if_stmt3: IF expr[cond] THEN stmt.list FI if_stmt3: IF expr[cond] THEN stmt.list FI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:27.30-38: possibly meant: $[stmt.list] at $4 test.y:27.30-38: possibly meant: $[stmt.list] at $4
if_stmt3: IF expr[cond] THEN stmt.list FI if_stmt3: IF expr[cond] THEN stmt.list FI
^^^^^^^^^ ^~~~~~~~~
test.y:30.43-46: error: ambiguous reference: '$xyz' test.y:30.43-46: error: ambiguous reference: '$xyz'
{ $if_stmt4 = new IfStmt($cond, $xyz, $cond); }; { $if_stmt4 = new IfStmt($cond, $xyz, $cond); };
^^^^ ^~~~
test.y:29.35-37: refers to: $xyz at $4 test.y:29.35-37: refers to: $xyz at $4
if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
^^^ ^~~
test.y:29.50-52: refers to: $xyz at $6 test.y:29.50-52: refers to: $xyz at $6
if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
^^^ ^~~
test.y:32.43-52: error: invalid reference: '$stmt.list' test.y:32.43-52: error: invalid reference: '$stmt.list'
{ $if_stmt5 = new IfStmt($cond, $stmt.list, $else); }; { $if_stmt5 = new IfStmt($cond, $stmt.list, $else); };
^^^^^^^^^^ ^~~~~~~~~~
test.y:31.11-32.63: symbol not found in production: stmt 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 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 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 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 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 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' test.y:34.43-58: error: invalid reference: '$stmt.list.field'
{ $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); }; { $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); };
^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~
test.y:33.11-34.69: symbol not found in production: stmt 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 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 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 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 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 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
^^^^ ^~~~
test.y:36.43-54: error: invalid reference: '$[stmt.list]' test.y:36.43-54: error: invalid reference: '$[stmt.list]'
{ $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); }; { $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); };
^^^^^^^^^^^^ ^~~~~~~~~~~~
test.y:35.11-36.71: symbol not found in production: stmt.list 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 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 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 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 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 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
^^^^ ^~~~
test.y:38.43-49: error: invalid reference: '$then.1' test.y:38.43-49: error: invalid reference: '$then.1'
{ $if_stmt8 = new IfStmt($cond, $then.1, $else); }; { $if_stmt8 = new IfStmt($cond, $then.1, $else); };
^^^^^^^ ^~~~~~~
test.y:37.11-38.60: symbol not found in production: then 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 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 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 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' test.y:40.43-55: error: invalid reference: '$then.1.field'
{ $if_stmt9 = new IfStmt($cond, $then.1.field, $else); }; { $if_stmt9 = new IfStmt($cond, $then.1.field, $else); };
^^^^^^^^^^^^^ ^~~~~~~~~~~~~
test.y:39.11-40.66: symbol not found in production: then 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 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 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 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' test.y:42.44-50: error: invalid reference: '$stmt.x'
{ $if_stmt10 = new IfStmt($cond, $stmt.x, 0); }; { $if_stmt10 = new IfStmt($cond, $stmt.x, 0); };
^^^^^^^ ^~~~~~~
test.y:41.12-42.57: symbol not found in production: stmt test.y:41.12-42.57: symbol not found in production: stmt
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI 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 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 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
^^^^^^ ^~~~~~
test.y:41.36-41: possibly meant: $[stmt.x] at $4 test.y:41.36-41: possibly meant: $[stmt.x] at $4
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
^^^^^^ ^~~~~~
test.y:44.13-22: error: invalid reference: '$if-stmt-a' test.y:44.13-22: error: invalid reference: '$if-stmt-a'
{ $if-stmt-a = new IfStmt($cond, $then, $else); }; { $if-stmt-a = new IfStmt($cond, $then, $else); };
^^^^^^^^^^ ^~~~~~~~~~
test.y:43.12-44.59: symbol not found in production: if 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 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 $$ 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 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' test.y:46.46-54: error: invalid reference: '$then-a.f'
{ $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); }; { $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); };
^^^^^^^^^ ^~~~~~~~~
test.y:45.12-46.65: symbol not found in production: then 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 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 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 if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
^^^^^^ ^~~~~~
]]) ]])
AT_CLEANUP AT_CLEANUP

View File

@@ -134,31 +134,31 @@ AT_BISON_CHECK([[-fcaret input.y]], 0, [],
input.y: warning: 9 rules useless in grammar [-Wother] input.y: warning: 9 rules useless in grammar [-Wother]
input.y:6.1-8: warning: nonterminal useless in grammar: useless1 [-Wother] input.y:6.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
useless1: '1'; useless1: '1';
^^^^^^^^ ^~~~~~~~
input.y:7.1-8: warning: nonterminal useless in grammar: useless2 [-Wother] input.y:7.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
useless2: '2'; useless2: '2';
^^^^^^^^ ^~~~~~~~
input.y:8.1-8: warning: nonterminal useless in grammar: useless3 [-Wother] input.y:8.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
useless3: '3'; useless3: '3';
^^^^^^^^ ^~~~~~~~
input.y:9.1-8: warning: nonterminal useless in grammar: useless4 [-Wother] input.y:9.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
useless4: '4'; useless4: '4';
^^^^^^^^ ^~~~~~~~
input.y:10.1-8: warning: nonterminal useless in grammar: useless5 [-Wother] input.y:10.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
useless5: '5'; useless5: '5';
^^^^^^^^ ^~~~~~~~
input.y:11.1-8: warning: nonterminal useless in grammar: useless6 [-Wother] input.y:11.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
useless6: '6'; useless6: '6';
^^^^^^^^ ^~~~~~~~
input.y:12.1-8: warning: nonterminal useless in grammar: useless7 [-Wother] input.y:12.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
useless7: '7'; useless7: '7';
^^^^^^^^ ^~~~~~~~
input.y:13.1-8: warning: nonterminal useless in grammar: useless8 [-Wother] input.y:13.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
useless8: '8'; useless8: '8';
^^^^^^^^ ^~~~~~~~
input.y:14.1-8: warning: nonterminal useless in grammar: useless9 [-Wother] input.y:14.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
useless9: '9'; 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: warning: 3 rules useless in grammar [-Wother]
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother] not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother]
not_reachable: useful { /* A not reachable action. */ } not_reachable: useful { /* A not reachable action. */ }
^^^^^^^^^^^^^ ^~~~~~~~~~~~~
not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother] not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother]
non_productive: non_productive useless_token non_productive: non_productive useless_token
^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother] not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
| non_productive { /* A non productive action. */ } | non_productive { /* A non productive action. */ }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]) ]])
AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' not-reduced.output]], 0, 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: warning: 3 rules useless in grammar [-Wother]
input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother] input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother]
underivable: indirection; underivable: indirection;
^^^^^^^^^^^ ^~~~~~~~~~~
input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother] input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother]
indirection: underivable; indirection: underivable;
^^^^^^^^^^^ ^~~~~~~~~~~
input.y:5.15-25: warning: rule useless in grammar [-Wother] input.y:5.15-25: warning: rule useless in grammar [-Wother]
exp: useful | underivable; exp: useful | underivable;
^^^^^^^^^^^ ^~~~~~~~~~~
]]) ]])
AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' input.output]], 0, AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' input.output]], 0,

View File

@@ -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]], [[]], AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] [[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %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] 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??!" %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]) ]])
AT_COMPILE([input]) AT_COMPILE([input])