mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
Introduce #[animation]
For now, only #[animation(error)] is supported on variants and it makes both #[derive(Animate)] and #[derive(ComputeSquaredDistance)] ignore this particular variant.
This commit is contained in:
parent
17d97cf87b
commit
ff67fc751d
5 changed files with 31 additions and 45 deletions
|
@ -19,13 +19,13 @@ mod to_animated_zero;
|
|||
mod to_computed_value;
|
||||
mod to_css;
|
||||
|
||||
#[proc_macro_derive(Animate)]
|
||||
#[proc_macro_derive(Animate, attributes(animation))]
|
||||
pub fn derive_animate(stream: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
|
||||
animate::derive(input).to_string().parse().unwrap()
|
||||
}
|
||||
|
||||
#[proc_macro_derive(ComputeSquaredDistance)]
|
||||
#[proc_macro_derive(ComputeSquaredDistance, attributes(animation))]
|
||||
pub fn derive_compute_squared_distance(stream: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
|
||||
compute_squared_distance::derive(input).to_string().parse().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue