Skip to content

Commit 4b4b6b3

Browse files
committed
Rename "args" to "params" in macros that consume function parameters
1 parent c6970fe commit 4b4b6b3

12 files changed

+173
-173
lines changed

crates/icrate/src/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ macro_rules! extern_static {
309309
macro_rules! extern_fn {
310310
(
311311
$(#[$m:meta])*
312-
$v:vis unsafe fn $name:ident($($args:tt)*) $(-> $res:ty)?;
312+
$v:vis unsafe fn $name:ident($($params:tt)*) $(-> $res:ty)?;
313313
) => {
314314
$(#[$m])*
315315
extern "C" {
316-
$v fn $name($($args)*) $(-> $res)?;
316+
$v fn $name($($params)*) $(-> $res)?;
317317
}
318318
};
319319
(
@@ -336,7 +336,7 @@ macro_rules! extern_fn {
336336
macro_rules! inline_fn {
337337
(
338338
$(#[$m:meta])*
339-
$v:vis unsafe fn $name:ident($($args:tt)*) $(-> $res:ty)? $body:block
339+
$v:vis unsafe fn $name:ident($($params:tt)*) $(-> $res:ty)? $body:block
340340
) => {
341341
// TODO
342342
};

crates/objc2/src/macros/__method_msg_send.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ macro_rules! __method_msg_send {
3030
(
3131
($receiver:expr)
3232
($($sel_rest:tt)*)
33-
($arg:ident: MainThreadMarker $(, $($args_rest:tt)*)?)
33+
($arg:ident: MainThreadMarker $(, $($params_rest:tt)*)?)
3434

3535
($($sel_parsed:tt)*)
3636
($($arg_parsed:tt)*)
@@ -39,7 +39,7 @@ macro_rules! __method_msg_send {
3939
$crate::__method_msg_send! {
4040
($receiver)
4141
($($sel_rest)*)
42-
($($($args_rest)*)?)
42+
($($($params_rest)*)?)
4343

4444
($($sel_parsed)*)
4545
($($arg_parsed)*)
@@ -50,15 +50,15 @@ macro_rules! __method_msg_send {
5050
(
5151
($receiver:expr)
5252
($($sel:ident)? : $($sel_rest:tt)*)
53-
($arg:ident : $_arg_ty:ty $(, $($args_rest:tt)*)?)
53+
($arg:ident : $_arg_ty:ty $(, $($params_rest:tt)*)?)
5454

5555
($($sel_parsed:tt)*)
5656
($($arg_parsed:tt)*)
5757
) => {
5858
$crate::__method_msg_send! {
5959
($receiver)
6060
($($sel_rest)*)
61-
($($($args_rest)*)?)
61+
($($($params_rest)*)?)
6262

6363
($($sel_parsed)* $($sel)? :)
6464
($($arg_parsed)* $arg,)
@@ -68,15 +68,15 @@ macro_rules! __method_msg_send {
6868
(
6969
($receiver:expr)
7070
($($sel:ident)? :: $($sel_rest:tt)*)
71-
($arg1:ident : $_arg_ty1:ty, $arg2:ident : $_arg_ty2:ty $(, $($args_rest:tt)*)?)
71+
($arg1:ident : $_arg_ty1:ty, $arg2:ident : $_arg_ty2:ty $(, $($params_rest:tt)*)?)
7272

7373
($($sel_parsed:tt)*)
7474
($($arg_parsed:tt)*)
7575
) => {
7676
$crate::__method_msg_send! {
7777
($receiver)
7878
($($sel_rest)*)
79-
($($($args_rest)*)?)
79+
($($($params_rest)*)?)
8080

8181
($($sel_parsed)* $($sel)? : :)
8282
($($arg_parsed)* $arg1, $arg2,)
@@ -139,7 +139,7 @@ macro_rules! __method_msg_send {
139139
(
140140
($receiver:expr)
141141
($($sel_rest:tt)*)
142-
($($args_rest:tt)*)
142+
($($params_rest:tt)*)
143143

144144
($($sel_parsed:tt)*)
145145
($($arg_parsed:tt)*)
@@ -181,7 +181,7 @@ macro_rules! __method_msg_send_id {
181181
(
182182
($receiver:expr)
183183
($($sel_rest:tt)*)
184-
($arg:ident: MainThreadMarker $(, $($args_rest:tt)*)?)
184+
($arg:ident: MainThreadMarker $(, $($params_rest:tt)*)?)
185185

186186
($($sel_parsed:tt)*)
187187
($($arg_parsed:tt)*)
@@ -191,7 +191,7 @@ macro_rules! __method_msg_send_id {
191191
$crate::__method_msg_send_id! {
192192
($receiver)
193193
($($sel_rest)*)
194-
($($($args_rest)*)?)
194+
($($($params_rest)*)?)
195195

196196
($($sel_parsed)*)
197197
($($arg_parsed)*)
@@ -203,7 +203,7 @@ macro_rules! __method_msg_send_id {
203203
(
204204
($receiver:expr)
205205
($($sel:ident)? : $($sel_rest:tt)*)
206-
($arg:ident : $_arg_ty:ty $(, $($args_rest:tt)*)?)
206+
($arg:ident : $_arg_ty:ty $(, $($params_rest:tt)*)?)
207207

208208
($($sel_parsed:tt)*)
209209
($($arg_parsed:tt)*)
@@ -212,7 +212,7 @@ macro_rules! __method_msg_send_id {
212212
$crate::__method_msg_send_id! {
213213
($receiver)
214214
($($sel_rest)*)
215-
($($($args_rest)*)?)
215+
($($($params_rest)*)?)
216216

217217
($($sel_parsed)* $($sel)? :)
218218
($($arg_parsed)* $arg,)
@@ -223,7 +223,7 @@ macro_rules! __method_msg_send_id {
223223
(
224224
($receiver:expr)
225225
($($sel:ident)? :: $($sel_rest:tt)*)
226-
($arg1:ident : $_arg_ty1:ty, $arg2:ident : $_arg_ty2:ty $(, $($args_rest:tt)*)?)
226+
($arg1:ident : $_arg_ty1:ty, $arg2:ident : $_arg_ty2:ty $(, $($params_rest:tt)*)?)
227227

228228
($($sel_parsed:tt)*)
229229
($($arg_parsed:tt)*)
@@ -232,7 +232,7 @@ macro_rules! __method_msg_send_id {
232232
$crate::__method_msg_send_id! {
233233
($receiver)
234234
($($sel_rest)*)
235-
($($($args_rest)*)?)
235+
($($($params_rest)*)?)
236236

237237
($($sel_parsed)* $($sel)? : :)
238238
($($arg_parsed)* $arg1, $arg2,)
@@ -301,7 +301,7 @@ macro_rules! __method_msg_send_id {
301301
(
302302
($receiver:expr)
303303
($($sel_rest:tt)*)
304-
($($args_rest:tt)*)
304+
($($params_rest:tt)*)
305305

306306
($($sel_parsed:tt)*)
307307
($($arg_parsed:tt)*)

crates/objc2/src/macros/__rewrite_self_arg.rs renamed to crates/objc2/src/macros/__rewrite_self_param.rs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
/// (builder_method:ident)
66
/// (receiver:expr)
77
/// (receiver_ty:ty)
8-
/// (args_prefix*)
9-
/// (args_rest*)
8+
/// (params_prefix*)
9+
/// (params_rest*)
1010
/// ```
1111
#[doc(hidden)]
1212
#[macro_export]
13-
macro_rules! __rewrite_self_arg {
13+
macro_rules! __rewrite_self_param {
1414
{
15-
($($args:tt)*)
15+
($($params:tt)*)
1616

1717
($out_macro:path)
1818
$($macro_args:tt)*
1919
} => {
20-
$crate::__rewrite_self_arg_inner! {
21-
// Duplicate args out so that we can match on `self`, while still
22-
// using it as a function argument
23-
($($args)*)
24-
($($args)*)
20+
$crate::__rewrite_self_param_inner! {
21+
// Duplicate params out so that we can match on `self`, while still
22+
// using it as a function parameter
23+
($($params)*)
24+
($($params)*)
2525

2626
($out_macro)
2727
$($macro_args)*
@@ -31,11 +31,11 @@ macro_rules! __rewrite_self_arg {
3131

3232
#[doc(hidden)]
3333
#[macro_export]
34-
macro_rules! __rewrite_self_arg_inner {
34+
macro_rules! __rewrite_self_param_inner {
3535
// Instance method
3636
{
37-
(&self $($__args_rest:tt)*)
38-
(&$self:ident $(, $($args_rest:tt)*)?)
37+
(&self $($__params_rest:tt)*)
38+
(&$self:ident $(, $($params_rest:tt)*)?)
3939

4040
($out_macro:path)
4141
$($macro_args:tt)*
@@ -50,12 +50,12 @@ macro_rules! __rewrite_self_arg_inner {
5050
&$self,
5151
_: $crate::runtime::Sel,
5252
)
53-
($($($args_rest)*)?)
53+
($($($params_rest)*)?)
5454
}
5555
};
5656
{
57-
(&mut self $($__args_rest:tt)*)
58-
(&mut $self:ident $(, $($args_rest:tt)*)?)
57+
(&mut self $($__params_rest:tt)*)
58+
(&mut $self:ident $(, $($params_rest:tt)*)?)
5959

6060
($out_macro:path)
6161
$($macro_args:tt)*
@@ -70,12 +70,12 @@ macro_rules! __rewrite_self_arg_inner {
7070
&mut $self,
7171
_: $crate::runtime::Sel,
7272
)
73-
($($($args_rest)*)?)
73+
($($($params_rest)*)?)
7474
}
7575
};
7676
{
77-
(self: $__self_ty:ty $(, $($__args_rest:tt)*)?)
78-
($self:ident: $self_ty:ty $(, $($args_rest:tt)*)?)
77+
(self: $__self_ty:ty $(, $($__params_rest:tt)*)?)
78+
($self:ident: $self_ty:ty $(, $($params_rest:tt)*)?)
7979

8080
($out_macro:path)
8181
$($macro_args:tt)*
@@ -90,12 +90,12 @@ macro_rules! __rewrite_self_arg_inner {
9090
$self: $self_ty,
9191
_: $crate::runtime::Sel,
9292
)
93-
($($($args_rest)*)?)
93+
($($($params_rest)*)?)
9494
}
9595
};
9696
{
97-
(mut self: $__self_ty:ty $(, $($__args_rest:tt)*)?)
98-
($mut:ident $self:ident: $self_ty:ty $(, $($args_rest:tt)*)?)
97+
(mut self: $__self_ty:ty $(, $($__params_rest:tt)*)?)
98+
($mut:ident $self:ident: $self_ty:ty $(, $($params_rest:tt)*)?)
9999

100100
($out_macro:path)
101101
$($macro_args:tt)*
@@ -110,16 +110,16 @@ macro_rules! __rewrite_self_arg_inner {
110110
$mut $self: $self_ty,
111111
_: $crate::runtime::Sel,
112112
)
113-
($($($args_rest)*)?)
113+
($($($params_rest)*)?)
114114
}
115115
};
116116

117117
// `this: Type` or `_this: Type` instance method
118118
// Workaround for arbitary self types being unstable
119119
// https://doc.rust-lang.org/nightly/unstable-book/language-features/arbitrary-self-types.html
120120
{
121-
(mut this: $__self_ty:ty $(, $($__args_rest:tt)*)?)
122-
($mut:ident $this:ident: $this_ty:ty $(, $($args_rest:tt)*)?)
121+
(mut this: $__self_ty:ty $(, $($__params_rest:tt)*)?)
122+
($mut:ident $this:ident: $this_ty:ty $(, $($params_rest:tt)*)?)
123123

124124
($out_macro:path)
125125
$($macro_args:tt)*
@@ -134,12 +134,12 @@ macro_rules! __rewrite_self_arg_inner {
134134
$mut $this: $this_ty,
135135
_: $crate::runtime::Sel,
136136
)
137-
($($($args_rest)*)?)
137+
($($($params_rest)*)?)
138138
}
139139
};
140140
{
141-
(this: $__self_ty:ty $(, $($__args_rest:tt)*)?)
142-
($this:ident: $this_ty:ty $(, $($args_rest:tt)*)?)
141+
(this: $__self_ty:ty $(, $($__params_rest:tt)*)?)
142+
($this:ident: $this_ty:ty $(, $($params_rest:tt)*)?)
143143

144144
($out_macro:path)
145145
$($macro_args:tt)*
@@ -154,12 +154,12 @@ macro_rules! __rewrite_self_arg_inner {
154154
$this: $this_ty,
155155
_: $crate::runtime::Sel,
156156
)
157-
($($($args_rest)*)?)
157+
($($($params_rest)*)?)
158158
}
159159
};
160160
{
161-
(mut _this: $__self_ty:ty $(, $($__args_rest:tt)*)?)
162-
($mut:ident $this:ident: $this_ty:ty $(, $($args_rest:tt)*)?)
161+
(mut _this: $__self_ty:ty $(, $($__params_rest:tt)*)?)
162+
($mut:ident $this:ident: $this_ty:ty $(, $($params_rest:tt)*)?)
163163

164164
($out_macro:path)
165165
$($macro_args:tt)*
@@ -174,12 +174,12 @@ macro_rules! __rewrite_self_arg_inner {
174174
$mut $this: $this_ty,
175175
_: $crate::runtime::Sel,
176176
)
177-
($($($args_rest)*)?)
177+
($($($params_rest)*)?)
178178
}
179179
};
180180
{
181-
(_this: $__self_ty:ty $(, $($__args_rest:tt)*)?)
182-
($this:ident: $this_ty:ty $(, $($args_rest:tt)*)?)
181+
(_this: $__self_ty:ty $(, $($__params_rest:tt)*)?)
182+
($this:ident: $this_ty:ty $(, $($params_rest:tt)*)?)
183183

184184
($out_macro:path)
185185
$($macro_args:tt)*
@@ -194,14 +194,14 @@ macro_rules! __rewrite_self_arg_inner {
194194
$this: $this_ty,
195195
_: $crate::runtime::Sel,
196196
)
197-
($($($args_rest)*)?)
197+
($($($params_rest)*)?)
198198
}
199199
};
200200

201201
// Class method
202202
{
203-
($($__args:tt)*)
204-
($($args_rest:tt)*)
203+
($($__params:tt)*)
204+
($($params_rest:tt)*)
205205

206206
($out_macro:path)
207207
$($macro_args:tt)*
@@ -216,7 +216,7 @@ macro_rules! __rewrite_self_arg_inner {
216216
_: &$crate::runtime::AnyClass,
217217
_: $crate::runtime::Sel,
218218
)
219-
($($args_rest)*)
219+
($($params_rest)*)
220220
}
221221
};
222222
}

0 commit comments

Comments
 (0)