summaryrefslogtreecommitdiff
path: root/test/err_syntax20.y
diff options
context:
space:
mode:
Diffstat (limited to 'test/err_syntax20.y')
-rw-r--r--test/err_syntax20.y36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/err_syntax20.y b/test/err_syntax20.y
new file mode 100644
index 0000000..880e018
--- /dev/null
+++ b/test/err_syntax20.y
@@ -0,0 +1,36 @@
+%{
+int yylex(void);
+static void yyerror(const char *);
+%}
+
+%type <check> expr
+%type <rechk> recur
+
+%%
+
+expr : '(' recur ')'
+ { $2 = 3; }
+ ;
+
+%%
+
+#include <stdio.h>
+
+int
+main(void)
+{
+ printf("yyparse() = %d\n", yyparse());
+ return 0;
+}
+
+int
+yylex(void)
+{
+ return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+ printf("%s\n", s);
+}