diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-29 21:52:47 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-29 22:12:37 +0900 |
commit | 90f28b5f7e7ef08e107e38002d122825764aad09 (patch) | |
tree | d80dfc08063727caa48fac4f28a929cb669c1465 /driver/syntax_error_test.go | |
parent | Change syntax of production directives (diff) | |
download | cotia-90f28b5f7e7ef08e107e38002d122825764aad09.tar.gz cotia-90f28b5f7e7ef08e107e38002d122825764aad09.tar.xz |
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.
Diffstat (limited to 'driver/syntax_error_test.go')
-rw-r--r-- | driver/syntax_error_test.go | 36 |
1 files changed, 24 insertions, 12 deletions
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, |