macro_rules! codegen_define_method {
($def:tt, {
type: class,
name: $cls:tt,
$($rest:tt)*
}, {
type: class_method,
rust_name: $rust_name:tt,
ruby_name: { $($ruby_name:tt)* },
self: (),
args: [ $($arg:tt : $argty:ty),* ],
ret: { $($ret:tt)* },
body: $body:tt
}) => { ... };
($def:tt, {
type: class,
name: $cls:tt,
meta: $meta:tt,
struct: $struct:tt,
$($rest:tt)*
}, {
type: instance_method,
rust_name: $rust_name:tt,
ruby_name: { $($ruby_name:tt)* },
self: { ownership: { $($ownership:tt)* }, name: $self:tt },
args: [ $($arg:tt : $argty:ty),* ],
ret: { $($ret:tt)* },
body: $body:tt
}) => { ... };
($def:tt, {
type: class,
name: $cls:tt,
meta: $meta:tt,
struct: $struct:tt,
$($rest:tt)*
}, {
type: initializer,
rust_name: $rust_name:tt,
ruby_name: { $($ruby_name:tt)* },
self: { ownership: {}, name: $self:tt },
args: [ $($arg:tt : $argty:ty),* ],
ret: { $($ret:tt)* },
body: $body:tt
}) => { ... };
}