aboutsummaryrefslogtreecommitdiff
path: root/grammar/follow_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-10-28 01:41:21 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-10-28 01:41:21 +0900
commit83bc2b1307d0e73424437649d26b804f20a83c38 (patch)
tree1abb5a6067a66548917fb6cb38335aafc5cd4fe1 /grammar/follow_test.go
parentUse maleeni v0.5.1 (diff)
downloadurubu-83bc2b1307d0e73424437649d26b804f20a83c38.tar.gz
urubu-83bc2b1307d0e73424437649d26b804f20a83c38.tar.xz
Add name directive to specify a grammar name
Diffstat (limited to '')
-rw-r--r--grammar/follow_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/grammar/follow_test.go b/grammar/follow_test.go
index 3500d14..ba2d973 100644
--- a/grammar/follow_test.go
+++ b/grammar/follow_test.go
@@ -22,6 +22,8 @@ func TestFollowSet(t *testing.T) {
{
caption: "productions contain only non-empty productions",
src: `
+%name test
+
expr
: expr add term
| term
@@ -50,6 +52,8 @@ id: "[A-Za-z_][0-9A-Za-z_]*";
{
caption: "productions contain an empty start production",
src: `
+%name test
+
s
:
;
@@ -62,6 +66,8 @@ s
{
caption: "productions contain an empty production",
src: `
+%name test
+
s
: foo
;
@@ -78,6 +84,8 @@ foo
{
caption: "a start production contains a non-empty alternative and empty alternative",
src: `
+%name test
+
s
: foo
|
@@ -92,6 +100,8 @@ foo: "foo";
{
caption: "a production contains non-empty alternative and empty alternative",
src: `
+%name test
+
s
: foo
;