aboutsummaryrefslogtreecommitdiffstats
path: root/components/style_derive/lib.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-08-22 18:45:30 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-08-22 19:12:47 +0200
commit7ee124b1ed4d5fb47c483d2238dfc9bbe66212df (patch)
tree0ad4625fbc206bfe7ba7fa4c64a69061cc8d693c /components/style_derive/lib.rs
parentfaaf31411a0a67f6acc3b6d463474f2ac92990f7 (diff)
downloadservo-7ee124b1ed4d5fb47c483d2238dfc9bbe66212df.tar.gz
servo-7ee124b1ed4d5fb47c483d2238dfc9bbe66212df.zip
Derive the most trivial Animate impls
Diffstat (limited to 'components/style_derive/lib.rs')
-rw-r--r--components/style_derive/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/style_derive/lib.rs b/components/style_derive/lib.rs
index 20f974a9e99..a41925ab410 100644
--- a/components/style_derive/lib.rs
+++ b/components/style_derive/lib.rs
@@ -9,6 +9,7 @@ extern crate synstructure;
use proc_macro::TokenStream;
+mod animate;
mod compute_squared_distance;
mod has_viewport_percentage;
mod to_animated_value;
@@ -16,6 +17,12 @@ mod to_animated_zero;
mod to_computed_value;
mod to_css;
+#[proc_macro_derive(Animate)]
+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)]
pub fn derive_compute_squared_distance(stream: TokenStream) -> TokenStream {
let input = syn::parse_derive_input(&stream.to_string()).unwrap();