Mercurial > touhou
diff formats/src/th06/ecl.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 | 11249e4b4e03 |
line wrap: on
line diff
--- a/formats/src/th06/ecl.rs +++ b/formats/src/th06/ecl.rs @@ -117,6 +117,12 @@ } } +macro_rules! gen_match { + ($arg_type:ident) => { + ${concat(le_, $arg_type)} + }; +} + macro_rules! declare_main_instructions { ($($opcode:tt => fn $name:ident($($arg:ident: $arg_type:ident),*)),*,) => { /// Available instructions in an `Ecl`. @@ -134,7 +140,7 @@ $( $opcode => { $( - let (i2, $arg) = concat_idents!(le_, $arg_type)(i)?; + let (i2, $arg) = gen_match!($arg_type)(i)?; i = i2; )* MainInstruction::$name($($arg),*) @@ -172,7 +178,7 @@ $( $opcode => { $( - let (i2, $arg) = concat_idents!(le_, $arg_type)(i)?; + let (i2, $arg) = gen_match!($arg_type)(i)?; i = i2; )* SubInstruction::$name($($arg),*)
