diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-10-28 01:41:21 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-10-28 01:41:21 +0900 |
commit | 83bc2b1307d0e73424437649d26b804f20a83c38 (patch) | |
tree | 1abb5a6067a66548917fb6cb38335aafc5cd4fe1 /grammar/first_test.go | |
parent | Use maleeni v0.5.1 (diff) | |
download | urubu-83bc2b1307d0e73424437649d26b804f20a83c38.tar.gz urubu-83bc2b1307d0e73424437649d26b804f20a83c38.tar.xz |
Add name directive to specify a grammar name
Diffstat (limited to 'grammar/first_test.go')
-rw-r--r-- | grammar/first_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/grammar/first_test.go b/grammar/first_test.go index 041f411..578825e 100644 --- a/grammar/first_test.go +++ b/grammar/first_test.go @@ -24,6 +24,8 @@ func TestGenFirst(t *testing.T) { { caption: "productions contain only non-empty productions", src: ` +%name test + expr : expr add term | term @@ -61,6 +63,8 @@ id: "[A-Za-z_][0-9A-Za-z_]*"; { caption: "productions contain the empty start production", src: ` +%name test + s : ; @@ -73,6 +77,8 @@ s { caption: "productions contain an empty production", src: ` +%name test + s : foo bar ; @@ -90,6 +96,8 @@ bar: "bar"; { caption: "a start production contains a non-empty alternative and empty alternative", src: ` +%name test + s : foo | @@ -105,6 +113,8 @@ foo: "foo"; { caption: "a production contains non-empty alternative and empty alternative", src: ` +%name test + s : foo ; |