grammar.g4 fixes

This commit is contained in:
ProgramSnail 2023-08-13 12:59:19 +03:00
parent f94edb035c
commit 6b093311df

View file

@ -3,8 +3,6 @@ grammar lang ;
// not always most recent grammar // not always most recent grammar
// not checked // not checked
// TODO
source_file: (statement)+ EOF ; source_file: (statement)+ EOF ;
statement: import statement: import
@ -27,7 +25,7 @@ function_definition: (definietion_info)? (ANNOTATION_INFO)* (constraint ';')*
(('=' ( /*prec 2*/ block | (super_expression ';'))) | ';') (('=' ( /*prec 2*/ block | (super_expression ';'))) | ';')
; ;
type_definition: (DEFINITION_INFO)? (ANNOTATION_INFO)* ('^')? type_definition: (DEFINITION_INFO)? (ANNOTATION_INFO)* (REFERENCE)?
(SIMPLE_TYPE_IDENTIFIER | TYPECLASS_IDENTIFIER) (SIMPLE_TYPE_IDENTIFIER | TYPECLASS_IDENTIFIER)
('[' (TYPECLASS_IDENTIFIER)+ ']')? ('[' (TYPECLASS_IDENTIFIER)+ ']')?
(ARGUMENT_TYPE_IDENTIFIER)* (ARGUMENT_TYPE_IDENTIFIER)*
@ -131,7 +129,7 @@ annotated_type: (ANNOTATION_IDENTIFIER)? scoped_type ;
array_type: '[[' type ']]' ; array_type: '[[' type ']]' ;
reference_type: /* prec -1 */ '^' scoped_type ; reference_type: /* prec -1 */ REFERENCE scoped_type ;
modified_type: scoped_type ('?' | '!') ; modified_type: scoped_type ('?' | '!') ;