@@ -29,7 +29,9 @@ pub fn write(language: &Language, classes: &[ql::TopLevel]) -> std::io::Result<(
2929fn create_ast_node_class < ' a > ( ) -> ql:: Class < ' a > {
3030 // Default implementation of `toString` calls `this.getAPrimaryQlClass()`
3131 let to_string = ql:: Predicate {
32- qldoc : Some ( String :: from ( "Gets a string representation of this element." ) ) ,
32+ qldoc : Some ( String :: from (
33+ "Gets a string representation of this element." ,
34+ ) ) ,
3335 name : "toString" ,
3436 overridden : false ,
3537 return_type : Some ( ql:: Type :: String ) ,
@@ -43,10 +45,18 @@ fn create_ast_node_class<'a>() -> ql::Class<'a> {
4345 ) ) ,
4446 ) ,
4547 } ;
46- let get_location =
47- create_none_predicate ( Some ( String :: from ( "Gets the location of this element." ) ) , "getLocation" , false , Some ( ql:: Type :: Normal ( "Location" ) ) ) ;
48- let get_a_field_or_child =
49- create_none_predicate ( Some ( String :: from ( "Gets a field or child node of this node." ) ) , "getAFieldOrChild" , false , Some ( ql:: Type :: Normal ( "AstNode" ) ) ) ;
48+ let get_location = create_none_predicate (
49+ Some ( String :: from ( "Gets the location of this element." ) ) ,
50+ "getLocation" ,
51+ false ,
52+ Some ( ql:: Type :: Normal ( "Location" ) ) ,
53+ ) ;
54+ let get_a_field_or_child = create_none_predicate (
55+ Some ( String :: from ( "Gets a field or child node of this node." ) ) ,
56+ "getAFieldOrChild" ,
57+ false ,
58+ Some ( ql:: Type :: Normal ( "AstNode" ) ) ,
59+ ) ;
5060 let get_parent = ql:: Predicate {
5161 qldoc : Some ( String :: from ( "Gets the parent of this element." ) ) ,
5262 name : "getParent" ,
@@ -63,7 +73,9 @@ fn create_ast_node_class<'a>() -> ql::Class<'a> {
6373 ) ,
6474 } ;
6575 let get_parent_index = ql:: Predicate {
66- qldoc : Some ( String :: from ( "Gets the index of this node among the children of its parent." ) ) ,
76+ qldoc : Some ( String :: from (
77+ "Gets the index of this node among the children of its parent." ,
78+ ) ) ,
6779 name : "getParentIndex" ,
6880 overridden : false ,
6981 return_type : Some ( ql:: Type :: Int ) ,
@@ -78,7 +90,9 @@ fn create_ast_node_class<'a>() -> ql::Class<'a> {
7890 ) ,
7991 } ;
8092 let get_a_primary_ql_class = ql:: Predicate {
81- qldoc : Some ( String :: from ( "Gets the name of the primary QL class for this element." ) ) ,
93+ qldoc : Some ( String :: from (
94+ "Gets the name of the primary QL class for this element." ,
95+ ) ) ,
8296 name : "getAPrimaryQlClass" ,
8397 overridden : false ,
8498 return_type : Some ( ql:: Type :: String ) ,
@@ -124,7 +138,9 @@ fn create_token_class<'a>() -> ql::Class<'a> {
124138 body : create_get_field_expr_for_column_storage ( "result" , "tokeninfo" , 4 , tokeninfo_arity) ,
125139 } ;
126140 let to_string = ql:: Predicate {
127- qldoc : Some ( String :: from ( "Gets a string representation of this element." ) ) ,
141+ qldoc : Some ( String :: from (
142+ "Gets a string representation of this element." ,
143+ ) ) ,
128144 name : "toString" ,
129145 overridden : true ,
130146 return_type : Some ( ql:: Type :: String ) ,
@@ -189,7 +205,9 @@ fn create_none_predicate<'a>(
189205/// name.
190206fn create_get_a_primary_ql_class < ' a > ( class_name : & ' a str ) -> ql:: Predicate < ' a > {
191207 ql:: Predicate {
192- qldoc : Some ( String :: from ( "Gets the name of the primary QL class for this element." ) ) ,
208+ qldoc : Some ( String :: from (
209+ "Gets the name of the primary QL class for this element." ,
210+ ) ) ,
193211 name : "getAPrimaryQlClass" ,
194212 overridden : true ,
195213 return_type : Some ( ql:: Type :: String ) ,
@@ -434,7 +452,10 @@ fn create_field_getters<'a>(
434452 } ;
435453 (
436454 ql:: Predicate {
437- qldoc : field. name . as_ref ( ) . map ( |name| format ! ( "Gets the node corresponding to the field `{}`." , name) ) ,
455+ qldoc : field
456+ . name
457+ . as_ref ( )
458+ . map ( |name| format ! ( "Gets the node corresponding to the field `{}`." , name) ) ,
438459 name : & field. getter_name ,
439460 overridden : false ,
440461 return_type,
0 commit comments