#![ cfg_attr( feature = "no_std", no_std ) ]
#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ]
#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ]
#![ doc( html_root_url = "https://docs.rs/for_each/latest/for_each/" ) ]
#![ cfg_attr( doc, doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "readme.md" ) ) ) ]
#![ cfg_attr( not( doc ), doc = "Iteration utilities" ) ]
#![ allow( clippy::empty_line_after_doc_comments ) ]
#![ allow( clippy::doc_markdown ) ]
#[ cfg( feature = "enabled" ) ]
mod private
{
#[ macro_export ]
macro_rules! for_each
{
(
$Callback: path, $( $Each: tt ),* $(,)?
) =>
{
$(
$crate::braces_unwrap!( $Callback, $Each );
)*
};
(
@Prefix $Prefix: tt
@Postfix $Postfix: tt
@Each $( $Each: tt )*
) =>
{
$crate::for_each!
{
$crate::identity where
@Prefix $Prefix
@Postfix $Postfix
@Each $( $Each )*
}
};
(
@Prefix $Prefix: tt
@Each $( $Each: tt )*
) =>
{
$crate::for_each!
{
$crate::identity where
@Prefix $Prefix
@Each $( $Each )*
}
};
(
@Postfix $Postfix: tt
@Each $( $Each: tt )*
) =>
{
$crate::for_each!
{
$crate::identity where
@Postfix $Postfix
@Each $( $Each )*
}
};
(
$Callback: path where
@Each $( $Each: tt )*
) =>
{
$(
$crate::braces_unwrap!( $Callback, $Each );
)*
};
(
$Callback: path
where
@Prefix $Prefix: tt
@Postfix $Postfix: tt
@Each $( $Each: tt )*
) =>
{
$(
$crate ::braces_unwrap!
(
$Callback where
@Prefix{ $Prefix }
@Postfix{ $Postfix }
@SRC{ $Each }
);
)*
};
(
$Callback: path where
@Prefix $Prefix: tt
@Each $( $Each: tt )*
) =>
{
$(
$crate ::braces_unwrap!
(
$Callback where
@Prefix{ $Prefix }
@SRC{ $Each }
);
)*
};
(
$Callback: path where
@Postfix $Postfix: tt
@Each $( $Each: tt )*
) =>
{
$(
$crate ::braces_unwrap!
(
$Callback where
@Postfix{ $Postfix }
@SRC{ $Each }
);
)*
};
}
#[ macro_export ]
macro_rules! braces_unwrap
{
( $Callback: path, { $( $Src: tt )* } )
=>
{
$Callback!
(
$( $Src )*
);
};
( $Callback: path, $( $Src: tt )* )
=>
{
$Callback!
(
$( $Src )*
);
};
(
$Callback: path where
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Src )*
);
};
(
$Callback: path where
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Src )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@Postfix{ $( $Postfix: tt )* }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@Postfix{ $( $Postfix: tt )* }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@Postfix{ $( $Postfix: tt )* }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@Postfix{ $( $Postfix: tt )* }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )*
);
};
(
$Callback: path where
@Prefix{ { $( $Prefix: tt )* } }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )*
);
};
(
$Callback: path where
@Prefix{ $( $Prefix: tt )* }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Prefix )* $( $Src )*
);
};
(
$Callback: path where
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Postfix{ { $( $Postfix: tt )* } }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Postfix{ $( $Postfix: tt )* }
@SRC{ { $( $Src: tt )* } }
)
=>
{
$Callback!
(
$( $Src )* $( $Postfix )*
);
};
(
$Callback: path where
@Postfix{ $( $Postfix: tt )* }
@SRC{ $( $Src: tt )* }
)
=>
{
$Callback!
(
$( $Src )* $( $Postfix )*
);
};
}
#[ macro_export ]
macro_rules! identity
{
(
$( $Src: tt )*
)
=>
{
$( $Src )*
};
}
pub use for_each;
pub use braces_unwrap;
pub use identity;
}
#[ cfg( feature = "enabled" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own :: *;
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod own
{
use super :: *;
#[ doc( inline ) ]
pub use orphan :: *;
}
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod orphan
{
use super :: *;
#[ doc( inline ) ]
pub use exposed :: *;
}
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod exposed
{
use super :: *;
#[ doc( inline ) ]
pub use prelude :: *;
}
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod prelude
{
use super :: *;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private ::for_each;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private ::braces_unwrap;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private ::identity;
}