From 1f3a47794832fbda8312266cdcf2ff999b527c07 Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Mon, 14 Aug 2023 11:19:08 +0300 Subject: [PATCH] .g4 fixes --- grammar.g4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grammar.g4 b/grammar.g4 index 187281e..edc33ec 100644 --- a/grammar.g4 +++ b/grammar.g4 @@ -125,6 +125,8 @@ variant_type: ('|')? annotated_type ('|' annotated_type)+ ; tuple_type: ('&')? annotated_type ('&' _annotated_type)+ ; +function_type: '((' (_annotated_type)+ '))'; + annotated_type: (ANNOTATION_IDENTIFIER)? scoped_type ; array_type: '[[' type ']]' ; @@ -141,6 +143,7 @@ type: simple_type | array_type | variant_type | tuple_type + | function_type ; scoped_type: simple_type @@ -148,6 +151,7 @@ scoped_type: simple_type | modified_type | array_type | '(' (variant_type | tuple_type) ')' + | function_type ; name_identifier: (ARGUMENT_NAME_IDENTIFIER | SIMPLE_NAME_IDENTIFIER) ;