8 releases

0.3.0 Mar 30, 2023
0.2.3 Sep 3, 2022
0.2.2 Aug 25, 2022
0.2.1 May 27, 2022
0.0.1 May 11, 2022

#2630 in Rust patterns

Download history 5/week @ 2023-12-04 11/week @ 2023-12-11 14/week @ 2023-12-18 170/week @ 2023-12-25 13/week @ 2024-01-01 19/week @ 2024-01-08 14/week @ 2024-01-15 9/week @ 2024-01-22 409/week @ 2024-01-29 241/week @ 2024-02-05 547/week @ 2024-02-12 24/week @ 2024-02-19 465/week @ 2024-02-26 53/week @ 2024-03-04 76/week @ 2024-03-11 86/week @ 2024-03-18

681 downloads per month
Used in 12 crates (5 directly)

MIT/Apache

85KB
2K SLoC

proc-easy

crates docs actions MIT/Apache loc

Macros to make writing proc-macro crates easy.

This crate provides mainly macros and supporting types and traits to reduce amount of boilerplate required for working with syn.

Currently most of the macros are targeted to construct types that then can be parses to configure proc-macro and proc-derive-macro implementation.

easy_token! - defines new custom token from ident. To be used in other structs.

easy_parse! - defines struct or enum that can be parsed and peeked from stream.

easy_argument! - defines struct with a token as a name and the rest to be parsed as-is.

easy_argument_group! - defines a group of arguments as enum of arguments.

easy_argument_tuple! - specialized version of easy_argument! that parses fields starting from 2nd as EasyArgumentFields inside parenthesis and in any order.

easy_argument_value! - specialized version of easy_argument! for 2 field structs. It defines 2nd field as a value that can be parsed after = token or inside parenthesis.

easy_separated! - defines struct that parses fields as EasyArgumentFields in any order. Does not accept trailing punctuation.

easy_terminated! - defines struct that parses fields as EasyArgumentFields in any order. Accepts trailing punctuation. Parses whole stream.

easy_attributes! - defines struct that parses fields as EasyArgumentFields from a slice of Attributes with specified namespace.

EasyArgumentField is implemented for types defined with easy_token!, easy_argument!, easy_argument_tuple!, easy_argument_value! and easy_argument_group! possibly wrapped in Option or Vec.

License

Licensed under either of

at your option.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~330–780KB
~19K SLoC