8
8
//! Parsing the `var` and `export` attributes on fields.
9
9
10
10
use crate :: class:: { Field , FieldVar , Fields , GetSet , GetterSetterImpl , UsageFlags } ;
11
- use crate :: util:: {
12
- format_function_registered_name_constant_name, format_function_registered_name_struct_name,
13
- ident,
14
- } ;
11
+ use crate :: util:: { format_func_name_constant_name, format_func_name_struct_name, ident} ;
15
12
use proc_macro2:: { Ident , TokenStream } ;
16
13
use quote:: quote;
17
14
@@ -42,7 +39,7 @@ impl FieldHint {
42
39
43
40
pub fn make_property_impl ( class_name : & Ident , fields : & Fields ) -> TokenStream {
44
41
let mut getter_setter_impls = Vec :: new ( ) ;
45
- let mut func_registered_name_consts = Vec :: new ( ) ;
42
+ let mut func_name_consts = Vec :: new ( ) ;
46
43
let mut export_tokens = Vec :: new ( ) ;
47
44
48
45
for field in & fields. all_fields {
@@ -144,14 +141,14 @@ pub fn make_property_impl(class_name: &Ident, fields: &Fields) -> TokenStream {
144
141
let getter_tokens = make_getter_setter (
145
142
getter. to_impl ( class_name, GetSet :: Get , field) ,
146
143
& mut getter_setter_impls,
147
- & mut func_registered_name_consts ,
144
+ & mut func_name_consts ,
148
145
& mut export_tokens,
149
146
class_name,
150
147
) ;
151
148
let setter_tokens = make_getter_setter (
152
149
setter. to_impl ( class_name, GetSet :: Set , field) ,
153
150
& mut getter_setter_impls,
154
- & mut func_registered_name_consts ,
151
+ & mut func_name_consts ,
155
152
& mut export_tokens,
156
153
class_name,
157
154
) ;
@@ -169,15 +166,15 @@ pub fn make_property_impl(class_name: &Ident, fields: &Fields) -> TokenStream {
169
166
170
167
// For each generated #[func], add a const.
171
168
// This is the name of the container struct, which is declared by the derive macro GodotClass.
172
- let class_functions_name = format_function_registered_name_struct_name ( class_name) ;
169
+ let class_functions_name = format_func_name_struct_name ( class_name) ;
173
170
174
171
quote ! {
175
172
impl #class_name {
176
173
#( #getter_setter_impls) *
177
174
}
178
175
179
176
impl #class_functions_name {
180
- #( #func_registered_name_consts ) *
177
+ #( #func_name_consts ) *
181
178
}
182
179
183
180
impl :: godot:: obj:: cap:: ImplementsGodotExports for #class_name {
@@ -195,7 +192,7 @@ pub fn make_property_impl(class_name: &Ident, fields: &Fields) -> TokenStream {
195
192
fn make_getter_setter (
196
193
getter_setter_impl : Option < GetterSetterImpl > ,
197
194
getter_setter_impls : & mut Vec < TokenStream > ,
198
- func_registered_name_consts : & mut Vec < TokenStream > ,
195
+ func_name_consts : & mut Vec < TokenStream > ,
199
196
export_tokens : & mut Vec < TokenStream > ,
200
197
class_name : & Ident ,
201
198
) -> TokenStream {
@@ -204,19 +201,19 @@ fn make_getter_setter(
204
201
function_name,
205
202
function_impl,
206
203
export_token,
207
- func_registered_name_const ,
204
+ func_name_const ,
208
205
} = getter_impl;
209
206
210
207
getter_setter_impls. push ( function_impl) ;
211
- func_registered_name_consts . push ( func_registered_name_const ) ;
208
+ func_name_consts . push ( func_name_const ) ;
212
209
export_tokens. push ( export_token) ;
213
210
214
211
let getter_setter_name = function_name. to_string ( ) ;
215
212
216
- let class_functions_name = format_function_registered_name_struct_name ( class_name) ;
213
+ let class_functions_name = format_func_name_struct_name ( class_name) ;
217
214
218
215
let getter_setter_fn_const =
219
- format_function_registered_name_constant_name ( class_name, & ident ( & getter_setter_name) ) ;
216
+ format_func_name_constant_name ( class_name, & ident ( & getter_setter_name) ) ;
220
217
quote ! { #class_functions_name:: #getter_setter_fn_const }
221
218
} else {
222
219
quote ! { "" }
0 commit comments