-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
implement item macros #3086
Copy link
Copy link
Closed
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone
Metadata
Metadata
Assignees
Labels
A-syntaxextArea: Syntax extensionsArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
It's already possible to invoke macros in item position, but
macro_rulescurrently only ever produces macros thatmr_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 ofoption<@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).