mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Move TransformStyle out of Mako files
This commit is contained in:
parent
579cef6a69
commit
1f8777bb0b
9 changed files with 63 additions and 13 deletions
|
@ -23,10 +23,19 @@ pub fn derive(input: DeriveInput) -> Tokens {
|
|||
|
||||
if variant_attrs.dimension {
|
||||
assert_eq!(bindings.len(), 1);
|
||||
assert!(variant_attrs.function.is_none(), "That makes no sense");
|
||||
assert!(
|
||||
variant_attrs.function.is_none() && variant_attrs.keyword.is_none(),
|
||||
"That makes no sense"
|
||||
);
|
||||
}
|
||||
|
||||
let mut expr = if !bindings.is_empty() {
|
||||
let mut expr = if let Some(keyword) = variant_attrs.keyword {
|
||||
assert!(bindings.is_empty());
|
||||
let keyword = keyword.to_string();
|
||||
quote! {
|
||||
::std::fmt::Write::write_str(dest, #keyword)
|
||||
}
|
||||
} else if !bindings.is_empty() {
|
||||
let mut expr = quote! {};
|
||||
if variant_attrs.iterable {
|
||||
assert_eq!(bindings.len(), 1);
|
||||
|
@ -128,6 +137,7 @@ pub struct CssVariantAttrs {
|
|||
pub iterable: bool,
|
||||
pub comma: bool,
|
||||
pub dimension: bool,
|
||||
pub keyword: Option<Ident>,
|
||||
pub aliases: Option<String>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue