File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ module.exports = grammar({
7474 [ $ . class_modifier , $ . simple_identifier ] ,
7575 // "internal" as visibility modifier conflicts with internal as an identifier
7676 [ $ . visibility_modifier , $ . simple_identifier ] ,
77+ // "operator" as visibility modifier conflicts with operator as an identifier
78+ [ $ . function_modifier , $ . simple_identifier ] ,
7779
7880 // "<x>.<y> = z assignment conflicts with <x>.<y>() function call"
7981 [ $ . _postfix_unary_expression , $ . _expression ] ,
@@ -1113,6 +1115,7 @@ module.exports = grammar({
11131115 "enum" ,
11141116 "annotation" ,
11151117 "internal" ,
1118+ "operator" ,
11161119 // TODO: More soft keywords
11171120 ) ,
11181121
Original file line number Diff line number Diff line change @@ -160,6 +160,8 @@ annotations.filter { annotation -> true }
160160
161161availability.associate { internal -> false }.toMap()
162162
163+ operators.filter { operator -> true }
164+
163165--------------------------------------------------------------------------------
164166
165167(source_file
@@ -209,7 +211,20 @@ availability.associate { internal -> false }.toMap()
209211 (navigation_suffix
210212 (simple_identifier)))
211213 (call_suffix
212- (value_arguments))))
214+ (value_arguments)))
215+ (call_expression
216+ (navigation_expression
217+ (simple_identifier)
218+ (navigation_suffix
219+ (simple_identifier)))
220+ (call_suffix
221+ (annotated_lambda
222+ (lambda_literal
223+ (lambda_parameters
224+ (variable_declaration
225+ (simple_identifier)))
226+ (statements
227+ (boolean_literal)))))))
213228
214229================================================================================
215230Value declaration with receiver type
Original file line number Diff line number Diff line change @@ -3,12 +3,20 @@ Top-level functions
33==================
44
55fun main() {}
6+ operator fun main() {}
67
78---
89
910(source_file
1011 (function_declaration
11- (simple_identifier) (function_value_parameters)
12+ (simple_identifier)
13+ (function_value_parameters)
14+ (function_body))
15+ (function_declaration
16+ (modifiers
17+ (function_modifier))
18+ (simple_identifier)
19+ (function_value_parameters)
1220 (function_body)))
1321
1422==================
You can’t perform that action at this time.
0 commit comments