//! A crate providing [derive macros](https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros)
//! for [Crystal Ball](https://docs.rs/crystal_ball/).
extern crate proc_macro;
mod derive_transformable;
/// Easily implement [`Transformable`](https://docs.rs/crystal_ball/latest/crystal_ball/math/trait.Transformable.html).
///
/// The implementation simply multiplies the new transform with the old one.
///
/// # Attributes
/// - `#[transform]`: declares which field should be used for the implementation
/// - `#[internal]`: for use in `crystal_ball` itself only
///
/// # Examples
///
/// ```
/// use crystal_ball::math::Transform;
/// use crystal_ball::Transformable;
///
/// #[derive(Copy, Clone, Default, Debug, PartialEq, Transformable)]
/// pub struct Sphere {
/// #[transform]
/// pub transform: Transform,
/// }
/// ```
#[proc_macro_derive(Transformable, attributes(transform, internal))]
pub fn derive_transformable(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
derive_transformable::derive_transformable(input)
}