From e0ef917f51bdc7f0ac34522c4139bc67686e09be Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Tue, 18 Jul 2023 11:39:18 +0300 Subject: [PATCH] typle access expression added --- grammar.g4 | 2 +- grammar.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/grammar.g4 b/grammar.g4 index 80aa4ca..58092d6 100644 --- a/grammar.g4 +++ b/grammar.g4 @@ -87,7 +87,7 @@ name_expression: constructor: type (ANNOTATION_IDENTIFIER)? scoped_expression)+ ; -lambda: '\\' ((ANNOTATION_IDENTIFIER)? ARGUMENT_NAME_IDENTIFIER)+ '->' expression ; +lambda: '\\' (ARGUMENT_NAME_IDENTIFIER)* '->' expression ; super_expression: match | condition diff --git a/grammar.js b/grammar.js index a41afa8..e1e973a 100644 --- a/grammar.js +++ b/grammar.js @@ -113,7 +113,7 @@ module.exports = grammar({ field('expression', $._expression), ), - // --- operator + // --- operators comma_expression: $ => prec.left(seq($._super_expression, ',', $._super_expression)), @@ -168,10 +168,7 @@ module.exports = grammar({ lambda: $ => seq( '\\', - repeat1(seq( - optional($.annotation_identifier), - $.argument_name_identifier, - )), + repeat($.argument_name_identifier), '->', $._expression, ),