]> git.saurik.com Git - bison.git/blobdiff - tests/input.at
regen
[bison.git] / tests / input.at
index 82d97f53fe49214792db9d1d0e32bca67ce07c77..ff1d3924d907f62413e2aa1e3f9cf23a77c8b285 100644 (file)
@@ -1371,6 +1371,39 @@ m4_popdef([AT_TEST])
 AT_CLEANUP
 
 
+## -------------- ##
+## Stray $ or @.  ##
+## -------------- ##
+
+AT_SETUP([[Stray $ or @]])
+
+# Give %printer and %destructor "<*> exp TOK" instead of "<*>" to
+# check that the warnings are reported once, not three times.
+
+AT_DATA_GRAMMAR([[input.y]],
+[[%token TOK
+%destructor     { $%; @%; } <*> exp TOK;
+%initial-action { $%; @%; };
+%printer        { $%; @%; } <*> exp TOK;
+%%
+exp: TOK        { $%; @%; $$ = $1; };
+]])
+
+AT_BISON_CHECK([[input.y]], 0, [],
+[[input.y:10.19: warning: stray '$'
+input.y:10.23: warning: stray '@'
+input.y:11.19: warning: stray '$'
+input.y:11.23: warning: stray '@'
+input.y:12.19: warning: stray '$'
+input.y:12.23: warning: stray '@'
+input.y:14.19: warning: stray '$'
+input.y:14.23: warning: stray '@'
+]])
+
+AT_CLEANUP
+
+
+
 ## ---------------- ##
 ## Code injection.  ##
 ## ---------------- ##