5 releases

0.2.0 Apr 12, 2024
0.2.0-alpha.1 Jan 15, 2024
0.1.5 Aug 9, 2021
0.1.4 Aug 9, 2021
0.1.0 Aug 8, 2021

#104 in #optional

Download history 24/week @ 2024-04-21 26/week @ 2024-04-28 17/week @ 2024-05-05 21/week @ 2024-05-12 36/week @ 2024-05-19 22/week @ 2024-05-26 18/week @ 2024-06-02 6/week @ 2024-06-09 10/week @ 2024-06-16 6/week @ 2024-06-23 2/week @ 2024-06-30 6/week @ 2024-07-07 18/week @ 2024-07-14 6/week @ 2024-07-21 21/week @ 2024-07-28 4/week @ 2024-08-04

51 downloads per month
Used in 4 crates (via proc-macro-kwargs)

MIT license

15KB
300 lines

proc-macro-kwargs

Keyword argument parsing for function-like procedural macros (Rust).

Example

example_macro!(
    name => bar,
    foo => i32
);

And here is the corresponding code in the proc macro:

#[derive(MacroKeywordArgs)]
struct MacroArgs {
    name: Ident,
    #[kwarg(optional)]
    optional: Option<syn::Expr>,
    #[kwarg(rename = "foo")
    tp: Type
}

See the tests for more detailed examples

Dependencies

~270–710KB
~17K SLoC