AT_CLEANUP
-## ----------------------------- ##
-## Reject bad %code qualifiers. ##
-## ----------------------------- ##
+## -------------------------------- ##
+## Reject unused %code qualifiers. ##
+## -------------------------------- ##
-AT_SETUP([Reject bad %code qualifiers])
+AT_SETUP([Reject unused %code qualifiers])
AT_DATA([input-c.y],
[[%code "" {}
+%code "bad" {}
+%code "bad" {}
%%
start: ;
]])
-AT_CHECK([[bison input-c.y]], [1], [],
-[[input-c.y: `' is not a recognized %code qualifier
+AT_CHECK([[bison input-c.y]], [0], [],
+[[input-c.y:1.7-8: warning: %code qualifier `' is not used
+input-c.y:2.7-11: warning: %code qualifier `bad' is not used
+input-c.y:3.7-11: warning: %code qualifier `bad' is not used
]])
AT_DATA([input-c-glr.y],
-[[%code "bad" {}
+[[%code "" {}
+%code "bad" {}
+ %code "bad" {}
%%
start: ;
]])
-AT_CHECK([[bison input-c-glr.y]], [1], [],
-[[input-c-glr.y: `bad' is not a recognized %code qualifier
+AT_CHECK([[bison input-c-glr.y]], [0], [],
+[[input-c-glr.y:1.7-8: warning: %code qualifier `' is not used
+input-c-glr.y:2.7-11: warning: %code qualifier `bad' is not used
+input-c-glr.y:3.8-12: warning: %code qualifier `bad' is not used
]])
AT_DATA([input-c++.y],
-[[%code "bad" {}
+[[%code "" {}
+%code "bad" {}
+ %code "" {}
%%
start: ;
]])
-AT_CHECK([[bison input-c++.y]], [1], [],
-[[input-c++.y: `bad' is not a recognized %code qualifier
+AT_CHECK([[bison input-c++.y]], [0], [],
+[[input-c++.y:1.7-8: warning: %code qualifier `' is not used
+input-c++.y:2.7-11: warning: %code qualifier `bad' is not used
+input-c++.y:3.8-9: warning: %code qualifier `' is not used
]])
AT_DATA([input-c++-glr.y],
[[%code "bad" {}
+%code "" {}
+%code "" {}
+%%
+start: ;
+]])
+AT_CHECK([[bison input-c++-glr.y]], [0], [],
+[[input-c++-glr.y:1.7-11: warning: %code qualifier `bad' is not used
+input-c++-glr.y:2.7-8: warning: %code qualifier `' is not used
+input-c++-glr.y:3.7-8: warning: %code qualifier `' is not used
+]])
+
+AT_DATA([special-char-@@.y],
+[[%code "bad" {}
+%code "" {}
+%code "" {}
+%%
+start: ;
+]])
+AT_CHECK([[bison special-char-@@.y]], [0], [],
+[[special-char-@@.y:1.7-11: warning: %code qualifier `bad' is not used
+special-char-@@.y:2.7-8: warning: %code qualifier `' is not used
+special-char-@@.y:3.7-8: warning: %code qualifier `' is not used
+]])
+
+AT_DATA([special-char-@:>@.y],
+[[%code "bad" {}
+%code "" {}
+%code "" {}
+%%
+start: ;
+]])
+AT_CHECK([[bison special-char-@:>@.y]], [0], [],
+[[special-char-@:>@.y:1.7-11: warning: %code qualifier `bad' is not used
+special-char-@:>@.y:2.7-8: warning: %code qualifier `' is not used
+special-char-@:>@.y:3.7-8: warning: %code qualifier `' is not used
+]])
+
+AT_CLEANUP
+
+
+## ---------------- ##
+## %define errors. ##
+## ---------------- ##
+
+AT_SETUP([%define errors])
+
+AT_DATA([input.y],
+[[%define "var" "value1"
+%define "var" "value1"
+ %define "var" "value2"
%%
start: ;
]])
-AT_CHECK([[bison input-c++-glr.y]], [1], [],
-[[input-c++-glr.y: `bad' is not a recognized %code qualifier
+
+AT_CHECK([[bison input.y]], [0], [],
+[[input.y:2.9-13: warning: %define variable `var' redefined
+input.y:3.10-14: warning: %define variable `var' redefined
+input.y:1.9-13: warning: %define variable `var' is not used
+input.y:2.9-13: warning: %define variable `var' is not used
+input.y:3.10-14: warning: %define variable `var' is not used
]])
AT_CLEANUP