style_derive: Support parse-time aliases.

This will allow #19659 to use derive on display using:

    #[parse(aliases = "-webkit-flex")]
    Flex,
    #[parse(aliases = "-webkit-inline-flex")]
    InlineFlex,

And such.
This commit is contained in:
Emilio Cobos Álvarez 2017-12-31 09:29:35 +01:00
parent 0af7ac6a4a
commit 537fda543e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 23 additions and 1 deletions

View file

@ -39,7 +39,7 @@ pub fn derive_to_animated_value(stream: TokenStream) -> TokenStream {
to_animated_value::derive(input).to_string().parse().unwrap()
}
#[proc_macro_derive(Parse)]
#[proc_macro_derive(Parse, attributes(parse))]
pub fn derive_parse(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
parse::derive(input).to_string().parse().unwrap()