From 2dd098d1e16bd0b8786ca97ccc7d3b06fa6bc3d1 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 12 Jun 2022 00:40:28 +0900 Subject: Prohibit using a pattern in an alternative When a syntax error occurs, the parser must provide a user with the names of expected tokens. However, if a pattern appears directly in an alternative, Vartan cannot assign an appropriate name to the pattern. Therefore, this commit prohibits alternatives from containing patterns. --- grammar/grammar_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grammar') diff --git a/grammar/grammar_test.go b/grammar/grammar_test.go index 52c7fb8..5d18029 100644 --- a/grammar/grammar_test.go +++ b/grammar/grammar_test.go @@ -2686,7 +2686,7 @@ foo #name test; s - : foo "bar"@b #ast foo b... + : foo 'bar'@b #ast foo b... ; foo -- cgit v1.2.3