2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2017-07-13 21:12:57 +00:00
|
|
|
macro_rules! gen {
|
|
|
|
($name:ident ( $($dol:tt $var:ident)* ) $($body:tt)*) => {
|
|
|
|
macro_rules! $name {
|
|
|
|
($($dol $var:ident)*) => {
|
|
|
|
$($body)*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gen!(m($var) $var);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 1;
|
|
|
|
assert_eq!(m!(x), 1);
|
|
|
|
}
|