Commit f0bd04ae authored by POTTIER Francois's avatar POTTIER Francois

Add a test of the new warning about unused %attribute declarations.

parent ae8735ec
File "unused-attribute.mly", line 3, characters 19-31:
Warning: this attribute could not be transferred to the symbol list(B)
File "unused-attribute.mly", line 2, characters 13-25:
Warning: this attribute could not be transferred to the symbol D
Warning: 2 states have an end-of-stream conflict.
File "../../src/standard.mly", line 170, characters 16-16:
Warning: production list(C) -> is never reduced.
Warning: in total, 1 productions are never reduced.
%token A B C
%attribute D [@foo "bar"] (* the symbol D is unknown, so this %attribute declaration cannot work *)
%attribute list(B) [@foo "bar"] (* the symbol list(B) is never created during expansion, so this declaration is not OK *)
%attribute list(C) [@foo "bar"] (* the symbol list(C) is created during expansion, so this declaration is OK *)
%start<unit> main
%%
main:
A B list(C) {}
File "unused-attribute.mly", line 3, characters 19-31:
Warning: this attribute could not be transferred to the symbol list(B)
File "unused-attribute.mly", line 2, characters 13-25:
Warning: this attribute could not be transferred to the symbol D
%start main
%token A
%token B
%token C
%type <unit> main
%%
list_C_ [@foo "bar"]:
{ ( [] )}
| x = C xs = list_C_
{ ( x :: xs )}
main:
_1 = A _2 = B _3 = list_C_
{ ()}
%%
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment