4 ms·
Macros in Rust don't need to be completely valid syntax. There are some requirements such as balanced parens and strings but the macro API is basically a token
by kevincox 6y ago
Macros in Rust don't need to be completely valid syntax. There are some requirements such as balanced parens and strings but the macro API is basically a token stream. The syntax requirements are just so that the compiler knows when the macro ends.
https://doc.rust-lang.org/1.7.0/book/macros.html#syntactic-requirements https://doc.rust-lang.org/1.7.0/book/macros.html#syntactic-r...