tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

lib.rs (2799B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
      4 
      5 #![recursion_limit = "128"]
      6 
      7 #[macro_use]
      8 extern crate darling;
      9 extern crate proc_macro;
     10 extern crate proc_macro2;
     11 #[macro_use]
     12 extern crate quote;
     13 #[macro_use]
     14 extern crate syn;
     15 extern crate synstructure;
     16 
     17 use proc_macro::TokenStream;
     18 
     19 mod animate;
     20 mod cg;
     21 mod compute_squared_distance;
     22 mod parse;
     23 mod specified_value_info;
     24 mod to_animated_value;
     25 mod to_animated_zero;
     26 mod to_computed_value;
     27 mod to_css;
     28 mod to_resolved_value;
     29 mod to_typed;
     30 
     31 #[proc_macro_derive(Animate, attributes(animate, animation))]
     32 pub fn derive_animate(stream: TokenStream) -> TokenStream {
     33    let input = syn::parse(stream).unwrap();
     34    animate::derive(input).into()
     35 }
     36 
     37 #[proc_macro_derive(ComputeSquaredDistance, attributes(animation, distance))]
     38 pub fn derive_compute_squared_distance(stream: TokenStream) -> TokenStream {
     39    let input = syn::parse(stream).unwrap();
     40    compute_squared_distance::derive(input).into()
     41 }
     42 
     43 #[proc_macro_derive(ToAnimatedValue)]
     44 pub fn derive_to_animated_value(stream: TokenStream) -> TokenStream {
     45    let input = syn::parse(stream).unwrap();
     46    to_animated_value::derive(input).into()
     47 }
     48 
     49 #[proc_macro_derive(Parse, attributes(css, parse))]
     50 pub fn derive_parse(stream: TokenStream) -> TokenStream {
     51    let input = syn::parse(stream).unwrap();
     52    parse::derive(input).into()
     53 }
     54 
     55 #[proc_macro_derive(ToAnimatedZero, attributes(animation, zero))]
     56 pub fn derive_to_animated_zero(stream: TokenStream) -> TokenStream {
     57    let input = syn::parse(stream).unwrap();
     58    to_animated_zero::derive(input).into()
     59 }
     60 
     61 #[proc_macro_derive(ToComputedValue, attributes(compute))]
     62 pub fn derive_to_computed_value(stream: TokenStream) -> TokenStream {
     63    let input = syn::parse(stream).unwrap();
     64    to_computed_value::derive(input).into()
     65 }
     66 
     67 #[proc_macro_derive(ToResolvedValue, attributes(resolve))]
     68 pub fn derive_to_resolved_value(stream: TokenStream) -> TokenStream {
     69    let input = syn::parse(stream).unwrap();
     70    to_resolved_value::derive(input).into()
     71 }
     72 
     73 #[proc_macro_derive(ToCss, attributes(css))]
     74 pub fn derive_to_css(stream: TokenStream) -> TokenStream {
     75    let input = syn::parse(stream).unwrap();
     76    to_css::derive(input).into()
     77 }
     78 
     79 #[proc_macro_derive(SpecifiedValueInfo, attributes(css, parse, value_info))]
     80 pub fn derive_specified_value_info(stream: TokenStream) -> TokenStream {
     81    let input = syn::parse(stream).unwrap();
     82    specified_value_info::derive(input).into()
     83 }
     84 
     85 #[proc_macro_derive(ToTyped, attributes(css, typed_value))]
     86 pub fn derive_to_typed(stream: TokenStream) -> TokenStream {
     87    let input = syn::parse(stream).unwrap();
     88    to_typed::derive(input).into()
     89 }