Skip to content

implement item macros #3086

Closed
Closed
@paulstansifer

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).

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions