2024-07-06 16:00:04 -05:00
|
|
|
//@ run-pass
|
|
|
|
|
|
|
|
#![feature(macro_metavar_expr_concat)]
|
|
|
|
|
|
|
|
macro_rules! turn_to_page {
|
2024-07-17 15:00:48 -05:00
|
|
|
($ident:ident, $literal:literal, $tt:tt) => {
|
2024-07-06 16:00:04 -05:00
|
|
|
const ${concat("Ḧ", $ident)}: i32 = 394;
|
2024-07-17 15:00:48 -05:00
|
|
|
const ${concat("Ḧ", $literal)}: i32 = 394;
|
|
|
|
const ${concat("Ḧ", $tt)}: i32 = 394;
|
2024-07-06 16:00:04 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2024-07-17 15:00:48 -05:00
|
|
|
turn_to_page!(P1, "Ṕ2", Ṕ);
|
|
|
|
assert_eq!(ḦṔ, 394);
|
|
|
|
assert_eq!(ḦP1, 394);
|
|
|
|
assert_eq!(ḦṔ2, 394);
|
|
|
|
|
2024-07-06 16:00:04 -05:00
|
|
|
}
|