aboutsummaryrefslogtreecommitdiff
path: root/grammar/first_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-05-07 20:41:33 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-05-10 23:14:41 +0900
commit3eb0e88f911386a4e6eca991c1471070596c5554 (patch)
tree4c3ea445a804d781b846739d70392ceb1353ea6d /grammar/first_test.go
parentMake #prec directive change only precedence and not associativity (diff)
downloadcotia-3eb0e88f911386a4e6eca991c1471070596c5554.tar.gz
cotia-3eb0e88f911386a4e6eca991c1471070596c5554.tar.xz
Change syntax for top-level directives
%name changes to: #name example; %left and %right change to: #prec ( #left a b #right c d );
Diffstat (limited to 'grammar/first_test.go')
-rw-r--r--grammar/first_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/grammar/first_test.go b/grammar/first_test.go
index 578825e..134f4bd 100644
--- a/grammar/first_test.go
+++ b/grammar/first_test.go
@@ -24,7 +24,7 @@ func TestGenFirst(t *testing.T) {
{
caption: "productions contain only non-empty productions",
src: `
-%name test
+#name test;
expr
: expr add term
@@ -63,7 +63,7 @@ id: "[A-Za-z_][0-9A-Za-z_]*";
{
caption: "productions contain the empty start production",
src: `
-%name test
+#name test;
s
:
@@ -77,7 +77,7 @@ s
{
caption: "productions contain an empty production",
src: `
-%name test
+#name test;
s
: foo bar
@@ -96,7 +96,7 @@ bar: "bar";
{
caption: "a start production contains a non-empty alternative and empty alternative",
src: `
-%name test
+#name test;
s
: foo
@@ -113,7 +113,7 @@ foo: "foo";
{
caption: "a production contains non-empty alternative and empty alternative",
src: `
-%name test
+#name test;
s
: foo