aboutsummaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/parser_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/driver/parser_test.go b/driver/parser_test.go
index 73d8fac..e32e34c 100644
--- a/driver/parser_test.go
+++ b/driver/parser_test.go
@@ -148,6 +148,46 @@ bar_text: "bar";
),
),
},
+ // Production `b` is unused.
+ {
+ specSrc: `
+a
+ : foo
+ ;
+b
+ : foo;
+foo: "foo";
+`,
+ src: `foo`,
+ specErr: true,
+ },
+ // Terminal `bar` is unused.
+ {
+ specSrc: `
+s
+ : foo
+ ;
+foo: "foo";
+bar: "bar";
+`,
+ src: `foo`,
+ specErr: true,
+ },
+ // Production `b` and terminal `bar` is unused.
+ {
+ specSrc: `
+a
+ : foo
+ ;
+b
+ : bar
+ ;
+foo: "foo";
+bar: "bar";
+`,
+ src: `foo`,
+ specErr: true,
+ },
{
specSrc: `
mode_tran_seq
@@ -258,6 +298,9 @@ bar: "bar";
{
specSrc: `
s
+ : foo
+ ;
+foo
: "foo" #ast #(s $1...)
;
`,