style: Have Parse derive respect #[css(skip)] on variant as well and derive Parse for KeywordSize.

Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: evSvk1RQGe
This commit is contained in:
Xidorn Quan 2018-04-29 09:03:31 +10:00 committed by Emilio Cobos Álvarez
parent 185e4ce61d
commit 43bb6364f6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 7 additions and 17 deletions

View file

@ -20,6 +20,10 @@ pub fn derive(input: DeriveInput) -> Tokens {
);
let variant_attrs = cg::parse_variant_attrs_from_ast::<CssVariantAttrs>(&variant.ast());
if variant_attrs.skip {
return match_body;
}
let identifier = cg::to_css_identifier(
&variant_attrs.keyword.unwrap_or(variant.ast().ident.as_ref().into()),
);