Skip to content

Question about parsing args passed to an attribute like macro #86

@SamWhited

Description

@SamWhited

If you get stuck with Macros 1.1 I am happy to provide help even if the issue is not related to syn. Please file a ticket in this repo.

Thanks!

Is there a similar crate to syn but for parsing arguments in an attribute like proc macro? Eg. if I write a macro that looks something like:

#[proc_macro_attribute]
pub fn buildmenu(args: TokenStream, input: TokenStream) -> TokenStream { input }

which is used like:

#[buildmenu(file="gtk/menu.xml")]struct MainMenu;

how can I parse the "file=…" since there's no TokenStream API yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions