My understanding is the reference's syntax sections should represent what is syntactically valid Rust. However, given the current syntax on the Macros by example page it implies the following code is syntactically invalid.
#[cfg(false)]
macro_rules! name {
struct Demo;
}
This in fact compiles fine. The macro_rules! acts as a normal macro call where the body is allowed to be any token stream. This means in the reference the MacroRules should actually be Token*.
I propose the reference by changed so that this page splits the syntax for the language vs the syntax inside macro_rules! calls. This way no content is lost, but the distinction is shown.
My understanding is the reference's syntax sections should represent what is syntactically valid Rust. However, given the current syntax on the Macros by example page it implies the following code is syntactically invalid.
This in fact compiles fine. The
macro_rules!acts as a normal macro call where the body is allowed to be any token stream. This means in the reference the MacroRules should actually beToken*.I propose the reference by changed so that this page splits the syntax for the language vs the syntax inside
macro_rules!calls. This way no content is lost, but the distinction is shown.