aboutsummaryrefslogtreecommitdiff
path: root/test/err_syntax9.y
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 11:48:44 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 11:48:44 +0000
commit85a764b2c52b853993b20c6291983a1aac223f47 (patch)
tree1bdadbfcfab1670a3e7f0d95591305d721d0480c /test/err_syntax9.y
parent0b234d7a89df4780e9d2ea9817afd5d3dfaf4d27 (diff)
byacc: readd tests in the importvendor/byacc
Diffstat (limited to 'test/err_syntax9.y')
-rw-r--r--test/err_syntax9.y32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/err_syntax9.y b/test/err_syntax9.y
new file mode 100644
index 000000000000..f3ec6fab319e
--- /dev/null
+++ b/test/err_syntax9.y
@@ -0,0 +1,32 @@
+%{
+int yylex(void);
+static void yyerror(const char *);
+%}
+
+%start text
+%token text '(' '*' '&'
+
+%%
+S: error
+%%
+
+#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);
+}