mirror of
https://codeberg.org/ProgramSnail/tree-sitter-lang.git
synced 2025-12-06 22:58:47 +00:00
grammar.g4 fixes
This commit is contained in:
parent
f94edb035c
commit
6b093311df
1 changed files with 2 additions and 4 deletions
|
|
@ -3,8 +3,6 @@ grammar lang ;
|
|||
// not always most recent grammar
|
||||
// not checked
|
||||
|
||||
// TODO
|
||||
|
||||
source_file: (statement)+ EOF ;
|
||||
|
||||
statement: import
|
||||
|
|
@ -27,7 +25,7 @@ function_definition: (definietion_info)? (ANNOTATION_INFO)* (constraint ';')*
|
|||
(('=' ( /*prec 2*/ block | (super_expression ';'))) | ';')
|
||||
;
|
||||
|
||||
type_definition: (DEFINITION_INFO)? (ANNOTATION_INFO)* ('^')?
|
||||
type_definition: (DEFINITION_INFO)? (ANNOTATION_INFO)* (REFERENCE)?
|
||||
(SIMPLE_TYPE_IDENTIFIER | TYPECLASS_IDENTIFIER)
|
||||
('[' (TYPECLASS_IDENTIFIER)+ ']')?
|
||||
(ARGUMENT_TYPE_IDENTIFIER)*
|
||||
|
|
@ -131,7 +129,7 @@ annotated_type: (ANNOTATION_IDENTIFIER)? scoped_type ;
|
|||
|
||||
array_type: '[[' type ']]' ;
|
||||
|
||||
reference_type: /* prec -1 */ '^' scoped_type ;
|
||||
reference_type: /* prec -1 */ REFERENCE scoped_type ;
|
||||
|
||||
modified_type: scoped_type ('?' | '!') ;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue