Closed
Description
It's already possible to invoke macros in item position, but macro_rules
currently only ever produces macros that mr_expr(...)
. It should be pretty easy to make it produce both kinds of macros. Perhaps (...) => (...)
defines expr macros and (...) => {...}
defines item macros?
Ideally, item macros should be able to produce multiple items. This would require changing fold.rs to handle ~[@item]
instead of option<@item>
, as it does now. This would require a bit more hacking; perhaps changing the AST to allow sequences of items in more places is an option (it should always be semantically valid, I believe).