#[macro_export]
macro_rules! print {
($($arg:tt)*) => {
$crate::io::_print(format_args!($($arg)*));
};
}
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));
($($arg:tt)*) => ($crate::print!("{}\n", format_args!($($arg)*)));
}
#[macro_export]
macro_rules! eprint {
($($arg:tt)*) => {
$crate::io::_eprint(format_args!($($arg)*));
};
}
#[macro_export]
macro_rules! eprintln {
() => ($crate::eprint!("\n"));
($($arg:tt)*) => ($crate::eprint!("{}\n", format_args!($($arg)*)));
}
#[macro_export]
macro_rules! dbg {
() => {
$crate::println!("[{}:{}:{}]", ::core::file!(), ::core::line!(), ::core::column!())
};
($val:expr $(,)?) => {
match $val {
tmp => {
$crate::println!("[{}:{}:{}] {} = {:#?}",
::core::file!(), ::core::line!(), ::core::column!(), ::core::stringify!($val), &tmp);
tmp
}
}
};
($($val:expr),+ $(,)?) => {
($($crate::dbg!($val)),+,)
};
}
#[macro_export]
macro_rules! edbg {
() => {
$crate::eprintln!("[{}:{}:{}]", ::core::file!(), ::core::line!(), ::core::column!())
};
($val:expr $(,)?) => {
match $val {
tmp => {
$crate::eprintln!("[{}:{}:{}] {} = {:#?}",
::core::file!(), ::core::line!(), ::core::column!(), ::core::stringify!($val), &tmp);
tmp
}
}
};
($($val:expr),+ $(,)?) => {
($($crate::dbg!($val)),+,)
};
}