## Invalid $n. ##
## ------------ ##
-AT_SETUP([Invalid \$n and @n])
+AT_SETUP([Invalid $n and @n])
AT_DATA([input.y],
[[%%
%destructor { destroy ($$); } <*>
%printer { destroy ($$); } <*>
-%destructor { destroy ($$); } <!> <!>
-%printer { destroy ($$); } <!> <!>
+%destructor { destroy ($$); } <> <>
+%printer { destroy ($$); } <> <>
-%destructor { destroy ($$); } <!>
-%printer { destroy ($$); } <!>
+%destructor { destroy ($$); } <>
+%printer { destroy ($$); } <>
%%
%destructor { destroy ($$); } <*>;
%printer { destroy ($$); } <*>;
-%destructor { destroy ($$); } <!>;
-%printer { destroy ($$); } <!>;
+%destructor { destroy ($$); } <>;
+%printer { destroy ($$); } <>;
]])
AT_CHECK([bison input.y], [1], [],
AT_SETUP([Unused values with default %destructor])
AT_DATA([[input.y]],
-[[%destructor { destroy ($$); } <!>
+[[%destructor { destroy ($$); } <>
%type <tag> tagged
%%
%{
static void yyerror (const char *s);
-static int yylex (void);
+int yylex (void);
%}
%type <ival> '@<:@'
return res;
}
-static int
+int
yylex (void)
{
static char const input[] = "@<:@\1\2$@{@oline@__@&t@oline__\
[[typedef int value;
#include "input.h"
+#ifndef YYPUSH_DECLS
int yyparse (void);
+#else
+int yylex (void);
+#endif
int
main (void)
AT_CHECK([bison -o input.c input.y])
AT_CLEANUP
+
+
+## --------------------- ##
+## %prec takes a token. ##
+## --------------------- ##
+
+AT_SETUP([%prec takes a token])
+
+# Bison once allowed %prec sym where sym was a nonterminal.
+
+AT_DATA([input.y],
+[[%%
+start: PREC %prec PREC ;
+PREC: ;
+]])
+
+AT_CHECK([bison input.y], [1], [],
+[[input.y:3.1-4: rule given for PREC, which is a token
+]])
+
+AT_CLEANUP