#[macro_export]
macro_rules! define_dbglike {
( $name:ident, $macro:path, expect, $format:literal, $($args:tt)* ) => {
$crate::_define_dbglike_impl!(
($), $name, $macro, expect, $format, $crate::define_writer!($($args)*)
);
};
( $name:ident, $macro:path, try, $format:literal, $($args:tt)* ) => {
$crate::_define_dbglike_impl!(
($), $name, $macro, try, $format, $crate::define_try_writer!($($args)*)
);
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! _define_dbglike_impl {
( ($d:tt), $name:ident, $macro:path, $handler:tt, $format:literal, $writer:expr ) => {
#[allow(unused_macros)]
macro_rules! $name {
() => {
$crate::dbgwrite!($macro, $writer, $handler, $format)
};
($d ($d args:tt)+) => {
$crate::dbgwrite!($macro, $writer, $handler, $format, $d ($d args)+)
};
}
};
}