macro_rules! with_dollar_sign {
    ($($body:tt)*) => { ... };
}
Expand description

Allows to write nested macros.

Related Rust issue

Example

#[macro_export]
macro_rules! create_t {
    ( $i18n:expr ) => {
        // This replaces $d with $ in the inner macro.
        seed::with_dollar_sign! {
            ($d:tt) => {
                macro_rules! t {
                    { $d key:expr } => {
                        {
                            $i18n.translate($d key, None)
                        }
                    };
                    { $d key:expr, $d args:expr } => {
                        {
                            $i18n.translate($d key, Some(&$d args))
                        }
                    };
                }
            }
        }
   }
}