38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
#[macro_export]
|
|
macro_rules! builder_trait_decl {
|
|
(
|
|
$scope:vis trait $name:ident
|
|
$(<
|
|
$generic0Name:ident $(: $generic0Bound:path)? $(, $genericNName:ident $(: $genericNBound:path)?)*
|
|
>)?
|
|
$(: $base0:path $(, $baseN:path)*)?
|
|
{ $($body:tt)* }
|
|
) => {
|
|
$scope trait $name
|
|
<
|
|
'source, 'pos, P:Pos<'pos>, CS:CollectedSubstring<'source>
|
|
$(, $generic0Name $(: $generic0Bound)? $(, $genericNName $(: $genericNBound)?)* )?
|
|
>
|
|
$(: $base0 $(, $baseN)*)?
|
|
{ $($body)* }
|
|
};
|
|
|
|
(
|
|
$scope:vis trait $name:ident
|
|
<
|
|
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
|
$(, $genericNName:ident $(: $genericNBound:path)?)*
|
|
>
|
|
$(: $base0:path $(, $baseN:path)*)?
|
|
{ $($body:tt)* }
|
|
) => {
|
|
$scope trait $name
|
|
<
|
|
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
|
P: Pos<'pos>, CS: CollectedSubstring<'source>
|
|
$(, $genericNName $(: $genericNBound)?)*
|
|
>
|
|
$(: $base0 $(, $baseN)*)?
|
|
{ $($body)* }
|
|
};
|
|
} |