@@ -140,18 +140,17 @@ impl ChildQuantity {
140
140
/// * `types` - The types of visible children the field can contain.
141
141
/// * `optional` - Do `N` nodes always have this field?
142
142
/// * `multiple` - Can `N` nodes have multiple children for this field?
143
- /// 3. `children_without_fields` - The *other* named children of `N` that are
144
- /// not associated with fields. Data regarding these children:
143
+ /// 3. `children_without_fields` - The *other* named children of `N` that are not associated with
144
+ /// fields. Data regarding these children:
145
145
/// * `types` - The types of named children with no field.
146
146
/// * `optional` - Do `N` nodes always have at least one named child with no field?
147
147
/// * `multiple` - Can `N` nodes have multiple named children with no field?
148
148
///
149
149
/// Each summary must account for some indirect factors:
150
- /// 1. hidden nodes. When a parent node `N` has a hidden child `C`, the visible
151
- /// children of `C` *appear* to be direct children of `N`.
152
- /// 2. aliases. If a parent node type `M` is aliased as some other type `N`,
153
- /// then nodes which *appear* to have type `N` may have internal structure based
154
- /// on `M`.
150
+ /// 1. hidden nodes. When a parent node `N` has a hidden child `C`, the visible children of `C`
151
+ /// *appear* to be direct children of `N`.
152
+ /// 2. aliases. If a parent node type `M` is aliased as some other type `N`, then nodes which
153
+ /// *appear* to have type `N` may have internal structure based on `M`.
155
154
pub fn get_variable_info (
156
155
syntax_grammar : & SyntaxGrammar ,
157
156
lexical_grammar : & LexicalGrammar ,
@@ -224,7 +223,8 @@ pub fn get_variable_info(
224
223
. entry ( field_name)
225
224
. or_insert_with ( ChildQuantity :: zero) ;
226
225
227
- // Inherit the types and quantities of hidden children associated with fields.
226
+ // Inherit the types and quantities of hidden children associated with
227
+ // fields.
228
228
if child_is_hidden && child_symbol. is_non_terminal ( ) {
229
229
let child_variable_info = & result[ child_symbol. index ] ;
230
230
did_change |= extend_sorted (
@@ -529,8 +529,8 @@ pub fn generate_node_types_json(
529
529
let fields_json = node_type_json. fields . as_mut ( ) . unwrap ( ) ;
530
530
for ( new_field, field_info) in & info. fields {
531
531
let field_json = fields_json. entry ( new_field. clone ( ) ) . or_insert_with ( || {
532
- // If another rule is aliased with the same name, and does *not* have this field,
533
- // then this field cannot be required.
532
+ // If another rule is aliased with the same name, and does *not* have this
533
+ // field, then this field cannot be required.
534
534
let mut field_json = FieldInfoJSON :: default ( ) ;
535
535
if node_type_existed {
536
536
field_json. required = false ;
@@ -540,8 +540,8 @@ pub fn generate_node_types_json(
540
540
populate_field_info_json ( field_json, field_info) ;
541
541
}
542
542
543
- // If another rule is aliased with the same name, any fields that aren't present in this
544
- // cannot be required.
543
+ // If another rule is aliased with the same name, any fields that aren't present in
544
+ // this cannot be required.
545
545
for ( existing_field, field_json) in fields_json. iter_mut ( ) {
546
546
if !info. fields . contains_key ( existing_field) {
547
547
field_json. required = false ;
0 commit comments