Expand description

Making proc-macro easy.

Macros

Defines attribute structure. First field is a attribute name. It must be EasyToken implementation that will be used to for EasyPeek implementation. In case of errors, attribute name and span will be used.

Defines attribute group as enum where each variant is attribute type.

Defines struct and implement EasyAttributes for it. Each field’s type must implement EasyAttributeField.

Defines flags and attribute group and fields for them. Flags can be parsed independently. They can be parsed inside attribute that can contain only one flag. They can be parsed inside attribute that accepts a list of flags if provided.

Defines structure or enum and implements Parse for it Also implements EasyPeek for structs if first field is prefixed with @. That field’s type must implement EasyPeek itself. Implements EasyPeek for all enums. First field in enum variant must implement EasyPeek. Or if there’s no fields in enum variant - it does not participate in parsing.

Produces type with specified name that implement EasyToken and can be parsed from the name ident.

Structs

Parses inner type braced. Implements EasyPeek and peeks opening brace.

Parses inner type bracketed. Implements EasyPeek and peeks opening bracket.

Parses inner type parenthesized. Implements EasyPeek and peeks opening parenthesis.

Traits

Trait for parsable attributes. Attributes should be peekable to choose which attribute to parse.

Trait for types that can be used as fields in easy attributes structures. Fields can parsed and extended when encountered again in parsing stream. If field is never encountered - default value will be used. If attribute type or group have no default wrap it into Option.

Trait that should be implemented for enums of where each variant is an attribute. It is also auto-implemented for all bare attributes. This trait is used to implement EasyAttributeField for various types.

Collection of attributes that can be parsed from array of attributes. Can be easily applied to field’s or type’s attributes vector.

Provides interface for peeking tokens before parsing. When implemented for complex structures, peeks first token.

Peekable, parsable token.