From 90f28b5f7e7ef08e107e38002d122825764aad09 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Tue, 29 Mar 2022 21:52:47 +0900 Subject: Move directives given to lexical productions Move all directives given to lexical productions from alternative directives to production directives. This change aims to ensure consistency with respect to the syntax of definitions of terminal symbols and non-terminal symbols. --- driver/syntax_error_test.go | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'driver/syntax_error_test.go') diff --git a/driver/syntax_error_test.go b/driver/syntax_error_test.go index a7f363f..329ccef 100644 --- a/driver/syntax_error_test.go +++ b/driver/syntax_error_test.go @@ -44,10 +44,14 @@ elem : a b c ; -ws: "[\u{0009}\u{0020}]+" #skip; -a: 'a'; -b: 'b'; -c: 'c'; +ws #skip + : "[\u{0009}\u{0020}]+"; +a + : 'a'; +b + : 'b'; +c + : 'c'; `, src: `!; a!; ab!;`, synErrCount: 3, @@ -66,10 +70,14 @@ elem : a b c ; -ws: "[\u{0009}\u{0020}]+" #skip; -a: 'a'; -b: 'b'; -c: 'c'; +ws #skip + : "[\u{0009}\u{0020}]+"; +a + : 'a'; +b + : 'b'; +c + : 'c'; `, // After the parser trasits to the error state reading the first invalid symbol ('!'), // the second and third invalid symbols ('!') are ignored. @@ -90,10 +98,14 @@ elem : a b c ; -ws: "[\u{0009}\u{0020}]+" #skip; -a: 'a'; -b: 'b'; -c: 'c'; +ws #skip + : "[\u{0009}\u{0020}]+"; +a + : 'a'; +b + : 'b'; +c + : 'c'; `, src: `!**; a!**; ab!**; abc!`, synErrCount: 4, -- cgit v1.2.3