Open denisandroid opened 4 years ago
You need to put a space between the ||
. I believe declarative macros do not have access to the individual parts of a "fused" token (unlike procedural macros).
Yeah, I noticed that adding a space makes the macro work properly, but that 's not the solution.
I can certainly add a rule with an empty set of arguments, but I turned here to avoid duplicating the code because the rule provides for a star.
It was expected that I could repeat the syntax of the closure in the macro, I repeated but the rule is not working out correctly.
Code:
Output:
Macro code using one or more elements works, but macro code without elements does not work. Although this is precisely the rule with the star.
Play: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bd27f49b9feeb021af76615321013784
Rust Version: stable 1.43.1 or rustc 1.45.0-nightly (a74d1862d 2020-05-14)