From 9b86acea537028587e5d00d602ac7e829356e323 Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Tue, 25 Jul 2023 12:28:44 +0300 Subject: [PATCH] array expression in function definition now can be used without semicolon --- corpus/test.langexp | 2 +- grammar.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/corpus/test.langexp b/corpus/test.langexp index 5146c0e..bd64caa 100644 --- a/corpus/test.langexp +++ b/corpus/test.langexp @@ -387,8 +387,8 @@ parse_number : Unit! = { (operator) (number_literal))) (simple_name_identifier) - (annotation_identifier) (argument_name_identifier) + (annotation_identifier) (type (simple_type_identifier)) (type diff --git a/grammar.js b/grammar.js index 4648076..33bab5c 100644 --- a/grammar.js +++ b/grammar.js @@ -66,7 +66,7 @@ module.exports = grammar({ optional($._reference), $.type, )))), - choice(seq('=', choice(prec(2, $.block), seq($._super_expression, ';'))), ';'), + choice(seq('=', choice(prec(2, choice($.block, $.array)), seq($._super_expression, ';'))), ';'), ), typeclass_definition: $ => seq(