Mercurial > touhou
diff formats/src/th06/std.rs @ 776:94033091458b
formats: Update to ${concat(…)} to build on current nightly
${concat(…)} replaces the removed concat_idents!() macro, but doesn’t support
being used in nested repetitions for now. We can remove the gen_match!() macro
once this is supported again.
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Tue, 14 Oct 2025 12:41:29 +0000 |
| parents | d08eb4c9fce3 |
| children | ee09657d3789 |
line wrap: on
line diff
--- a/formats/src/th06/std.rs +++ b/formats/src/th06/std.rs @@ -124,6 +124,12 @@ } } +macro_rules! gen_match { + ($arg_type:ident) => { + ${concat(le_, $arg_type)} + }; +} + macro_rules! declare_stage_instructions { ($($opcode:tt => fn $name:ident($($arg:ident: $arg_type:ident),*)),*,) => { /// Available instructions in an `Stage`. @@ -141,7 +147,7 @@ $( $opcode => { $( - let (i2, $arg) = concat_idents!(le_, $arg_type)(i)?; + let (i2, $arg) = gen_match!($arg_type)(i)?; i = i2; )* Instruction::$name($($arg),*)
