I need to generate an exported macro using an outer macro, where the inner, exported macro uses Kleene operators. So something like this:
#[macro_export]
macro_rules! foo {
() => {
#[macro_export]
macro_rules! bar {
( $(things:expr)* ) => {
// code
};
}
};
}
Is there any way that rustc will allow me to do this? If I try the example verbatim rustc errors out with:
Standard Error
Compiling playground v0.0.1 (file:///playground)
error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
--> src/main.rs:6:16
|
6 | ( $(things:expr)* ) => {
| ^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.