From 83bc2b1307d0e73424437649d26b804f20a83c38 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Thu, 28 Oct 2021 01:41:21 +0900 Subject: Add name directive to specify a grammar name --- driver/syntax_error_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'driver/syntax_error_test.go') diff --git a/driver/syntax_error_test.go b/driver/syntax_error_test.go index a019b61..579ead1 100644 --- a/driver/syntax_error_test.go +++ b/driver/syntax_error_test.go @@ -19,6 +19,8 @@ func TestParserWithSyntaxErrors(t *testing.T) { { caption: "the parser can report a syntax error", specSrc: ` +%name test + s : foo ; @@ -31,6 +33,8 @@ foo: 'foo'; { caption: "when the parser reduced a production having the reduce directive, the parser will recover from an error state", specSrc: ` +%name test + seq : seq elem ';' | elem ';' @@ -51,6 +55,8 @@ c: 'c'; { caption: "After the parser shifts the error symbol, symbols are ignored until a symbol the parser can perform shift appears", specSrc: ` +%name test + seq : seq elem ';' | elem ';' @@ -73,6 +79,8 @@ c: 'c'; { caption: "when the parser performs shift three times, the parser recovers from the error state", specSrc: ` +%name test + seq : seq elem ';' | elem ';' -- cgit v1.2.3