aboutsummaryrefslogtreecommitdiff
path: root/grammar/grammar_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/grammar_test.go')
-rw-r--r--grammar/grammar_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/grammar/grammar_test.go b/grammar/grammar_test.go
index 1448d3c..0295798 100644
--- a/grammar/grammar_test.go
+++ b/grammar/grammar_test.go
@@ -1024,6 +1024,34 @@ foo
errs: []*SemanticError{semErrDuplicateElem},
},
{
+ caption: "symbol `foo` is ambiguous because it appears in an alternative twice",
+ specSrc: `
+%name test
+
+s
+ : foo foo #ast foo
+ ;
+
+foo
+ : 'foo';
+`,
+ errs: []*SemanticError{semErrAmbiguousElem},
+ },
+ {
+ caption: "symbol `foo` is ambiguous because it appears in an alternative twice, even if one of them has a label",
+ specSrc: `
+%name test
+
+s
+ : foo@x foo #ast foo
+ ;
+
+foo
+ : 'foo';
+`,
+ errs: []*SemanticError{semErrAmbiguousElem},
+ },
+ {
caption: "the expansion operator cannot be applied to a terminal symbol",
specSrc: `
%name test