@@ -79,23 +79,21 @@ named:
7979 array_literal :
8080 element* : expression
8181 array_type :
82- element+ : [type_modifiers, unannotated_type]
83- name : unannotated_type
82+ element : type
8483 as_expression :
8584 $children : as_operator
8685 expr : expression
87- name : unannotated_type
88- type+ : [type_modifiers, unannotated_type]
86+ type : type
8987 as_operator :
9088 assignment :
9189 operator : ["%=", "*=", "+=", "-=", "/=", "="]
9290 result : expression
9391 target : directly_assignable_expression
9492 associatedtype_declaration :
9593 $children* : [modifiers, type_constraints]
96- default_value* : [type_modifiers, unannotated_type]
97- must_inherit* : [type_modifiers, unannotated_type]
98- name+ : [ type_identifier, unannotated_type]
94+ default_value? : type
95+ must_inherit? : type
96+ name : type_identifier
9997 attribute :
10098 $children+ : [expression, user_type]
10199 availability_condition :
@@ -126,10 +124,9 @@ named:
126124 error? : pattern
127125 catch_keyword :
128126 check_expression :
129- name : unannotated_type
130127 op : " is"
131128 target : expression
132- type+ : [type_modifiers, unannotated_type]
129+ type : type
133130 class_body :
134131 $children* : [associatedtype_declaration, class_declaration, deinit_declaration, function_declaration, import_declaration, init_declaration, multiline_comment, operator_declaration, precedence_group_declaration, property_declaration, protocol_declaration, subscript_declaration, typealias_declaration]
135132 class_declaration :
@@ -175,9 +172,8 @@ named:
175172 key* : expression
176173 value* : expression
177174 dictionary_type :
178- key+ : [type_modifiers, unannotated_type]
179- name+ : unannotated_type
180- value+ : [type_modifiers, unannotated_type]
175+ key : type
176+ value : type
181177 didset_clause :
182178 $children* : [modifiers, simple_identifier, statements]
183179 directive :
@@ -199,13 +195,11 @@ named:
199195 name+ : simple_identifier
200196 raw_value* : expression
201197 enum_type_parameters :
202- $children* : [expression, type_modifiers, wildcard_pattern]
203- name* : unannotated_type
198+ $children* : [expression, type, wildcard_pattern]
204199 equality_constraint :
205200 $children* : attribute
206201 constrained_type : [identifier, nested_type_identifier]
207- must_equal+ : [type_modifiers, unannotated_type]
208- name : unannotated_type
202+ must_equal : type
209203 equality_expression :
210204 lhs : expression
211205 op : ["!=", "!==", "==", "==="]
@@ -225,14 +219,13 @@ named:
225219 $children* : [attribute, inheritance_modifier, modifiers, ownership_modifier, parameter, property_behavior_modifier, throws, throws_clause, type_constraints, type_parameters]
226220 body : function_body
227221 default_value* : expression
228- name+ : [referenceable_operator, simple_identifier, unannotated_type ]
229- return_type* : [implicitly_unwrapped_type, type_modifiers, unannotated_type ]
222+ name : [referenceable_operator, simple_identifier]
223+ return_type? : [implicitly_unwrapped_type, type ]
230224 function_modifier :
231225 function_type :
232226 $children? : [throws, throws_clause]
233- name : unannotated_type
234227 params : unannotated_type
235- return_type+ : [type_modifiers, unannotated_type]
228+ return_type : type
236229 getter_specifier :
237230 $children* : [mutation_modifier, throws, throws_clause]
238231 guard_statement :
@@ -242,15 +235,13 @@ named:
242235 identifier :
243236 $children+ : simple_identifier
244237 if_condition :
245- $children* : [availability_condition, expression, pattern, type_annotation, type_modifiers , user_type, value_binding_pattern, where_clause, wildcard_pattern]
238+ $children* : [availability_condition, expression, pattern, type, type_annotation , user_type, value_binding_pattern, where_clause, wildcard_pattern]
246239 bound_identifier? : simple_identifier
247- name? : unannotated_type
248240 if_statement :
249241 $children* : [else, if_statement, statements]
250242 condition+ : if_condition
251243 implicitly_unwrapped_type :
252- $children? : type_modifiers
253- name : unannotated_type
244+ $children : type
254245 import_declaration :
255246 $children+ : [identifier, modifiers]
256247 infix_expression :
@@ -260,8 +251,7 @@ named:
260251 inheritance_constraint :
261252 $children* : attribute
262253 constrained_type : [identifier, nested_type_identifier]
263- inherits_from+ : [implicitly_unwrapped_type, type_modifiers, unannotated_type]
264- name? : unannotated_type
254+ inherits_from : [implicitly_unwrapped_type, type]
265255 inheritance_modifier :
266256 inheritance_specifier :
267257 inherits_from : [function_type, suppressed_constraint, user_type]
@@ -282,8 +272,7 @@ named:
282272 $children : expression
283273 lambda_function_type :
284274 $children* : [lambda_function_type_parameters, throws, throws_clause]
285- name? : unannotated_type
286- return_type* : [implicitly_unwrapped_type, type_modifiers, unannotated_type]
275+ return_type? : [implicitly_unwrapped_type, type]
287276 lambda_function_type_parameters :
288277 $children+ : lambda_parameter
289278 lambda_literal :
@@ -293,8 +282,8 @@ named:
293282 lambda_parameter :
294283 $children? : [parameter_modifiers, self_expression]
295284 external_name? : simple_identifier
296- name* : [ simple_identifier, unannotated_type]
297- type* : [implicitly_unwrapped_type, type_modifiers, unannotated_type ]
285+ name? : simple_identifier
286+ type? : [implicitly_unwrapped_type, type ]
298287 line_str_text :
299288 line_string_literal :
300289 interpolation* : interpolated_expression
@@ -352,15 +341,14 @@ named:
352341 parameter :
353342 $children? : parameter_modifiers
354343 external_name? : simple_identifier
355- name+ : [ simple_identifier, unannotated_type]
356- type+ : [implicitly_unwrapped_type, type_modifiers, unannotated_type ]
344+ name : simple_identifier
345+ type : [implicitly_unwrapped_type, type ]
357346 parameter_modifier :
358347 parameter_modifiers :
359348 $children+ : parameter_modifier
360349 pattern :
361- $children* : [expression, pattern, type_modifiers , user_type, value_binding_pattern, wildcard_pattern]
350+ $children* : [expression, pattern, type , user_type, value_binding_pattern, wildcard_pattern]
362351 bound_identifier? : simple_identifier
363- name? : unannotated_type
364352 playground_literal :
365353 $children+ : expression
366354 postfix_expression :
@@ -395,8 +383,8 @@ named:
395383 protocol_function_declaration :
396384 $children* : [attribute, modifiers, parameter, statements, throws, throws_clause, type_constraints, type_parameters]
397385 default_value* : expression
398- name* : [referenceable_operator, simple_identifier, unannotated_type ]
399- return_type* : [implicitly_unwrapped_type, type_modifiers, unannotated_type ]
386+ name? : [referenceable_operator, simple_identifier]
387+ return_type? : [implicitly_unwrapped_type, type ]
400388 protocol_property_declaration :
401389 $children+ : [modifiers, protocol_property_requirements, type_annotation, type_constraints]
402390 name : pattern
@@ -441,8 +429,7 @@ named:
441429 subscript_declaration :
442430 $children+ : [attribute, computed_property, modifiers, parameter, type_constraints, type_parameters]
443431 default_value* : expression
444- name? : unannotated_type
445- return_type* : [implicitly_unwrapped_type, type_modifiers, unannotated_type]
432+ return_type? : [implicitly_unwrapped_type, type]
446433 super_expression :
447434 suppressed_constraint :
448435 suppressed : type_identifier
@@ -474,14 +461,15 @@ named:
474461 tuple_type_item :
475462 $children* : [parameter_modifiers, wildcard_pattern]
476463 element? : [dictionary_type, existential_type, opaque_type]
477- name* : [simple_identifier, unannotated_type]
478- type* : [type_modifiers, unannotated_type]
464+ name? : simple_identifier
465+ type? : type
466+ type :
467+ modifiers? : type_modifiers
468+ name : unannotated_type
479469 type_annotation :
480- name? : unannotated_type
481- type+ : [implicitly_unwrapped_type, type_modifiers, unannotated_type]
470+ type : [implicitly_unwrapped_type, type]
482471 type_arguments :
483- $children* : type_modifiers
484- name+ : unannotated_type
472+ $children+ : type
485473 type_constraint :
486474 $children : [equality_constraint, inheritance_constraint]
487475 type_constraints :
@@ -492,8 +480,7 @@ named:
492480 type_pack_expansion :
493481 $children : unannotated_type
494482 type_parameter :
495- $children+ : [type_identifier, type_modifiers, type_parameter_modifiers, type_parameter_pack]
496- name? : unannotated_type
483+ $children+ : [type, type_identifier, type_parameter_modifiers, type_parameter_pack]
497484 type_parameter_modifiers :
498485 $children+ : attribute
499486 type_parameter_pack :
@@ -502,8 +489,8 @@ named:
502489 $children+ : [type_constraints, type_parameter]
503490 typealias_declaration :
504491 $children* : [attribute, inheritance_modifier, modifiers, ownership_modifier, property_behavior_modifier, type_parameters]
505- name+ : [ type_identifier, unannotated_type]
506- value+ : [type_modifiers, unannotated_type]
492+ name : type_identifier
493+ value : type
507494 user_type :
508495 $children+ : [type_arguments, type_identifier]
509496 value_argument :
0 commit comments