From a6001b32cf805c4e72e05adc37ee60272a600bf1 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sat, 5 Nov 2022 16:52:37 +0900 Subject: Remove anonymous symbol system Remove unimportant features to tidy up the specification. --- driver/syntax_error_test.go | 47 ++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'driver/syntax_error_test.go') diff --git a/driver/syntax_error_test.go b/driver/syntax_error_test.go index ada1fb0..683e355 100644 --- a/driver/syntax_error_test.go +++ b/driver/syntax_error_test.go @@ -26,7 +26,8 @@ s : foo ; -foo: 'foo'; +foo + : 'foo'; `, src: `bar`, synErrCount: 1, @@ -37,9 +38,9 @@ foo: 'foo'; #name test; seq - : seq elem ';' - | elem ';' - | error ';' #recover + : seq elem semi_colon + | elem semi_colon + | error semi_colon #recover ; elem : a b c @@ -47,6 +48,8 @@ elem ws #skip : "[\u{0009}\u{0020}]+"; +semi_colon + : ';'; a : 'a'; b @@ -63,9 +66,9 @@ c #name test; seq - : seq elem ';' - | elem ';' - | error ';' #recover + : seq elem semi_colon + | elem semi_colon + | error semi_colon #recover ; elem : a b c @@ -73,6 +76,8 @@ elem ws #skip : "[\u{0009}\u{0020}]+"; +semi_colon + : ';'; a : 'a'; b @@ -91,9 +96,9 @@ c #name test; seq - : seq elem ';' - | elem ';' - | error '*' '*' ';' + : seq elem semi_colon + | elem semi_colon + | error star star semi_colon ; elem : a b c @@ -101,6 +106,10 @@ elem ws #skip : "[\u{0009}\u{0020}]+"; +semi_colon + : ';'; +star + : '*'; a : 'a'; b @@ -241,24 +250,6 @@ foo "", }, }, - { - caption: "when an anonymous symbol is expected, an expected symbol list contains an auto-generated name with the prefix `x_`", - specSrc: ` -#name test; - -s - : foo 'bar' - ; - -foo - : 'foo'; -`, - src: `foobaz`, - cause: `baz`, - expected: []string{ - "x_1", - }, - }, } for i, tt := range tests { t.Run(fmt.Sprintf("#%v", i), func(t *testing.T) { -- cgit v1.2.3