Skip to main content

xtal_macros/
lib.rs

1use proc_macro::TokenStream;
2
3mod sketch_components;
4mod uniforms;
5
6/// Saves sketches from the burden of having to manually implement the
7/// `SketchDerived` trait which is required to integrate a sketch's controls and
8/// animations usages with the UI
9#[proc_macro_derive(SketchComponents, attributes(sketch))]
10pub fn sketch_components(input: TokenStream) -> TokenStream {
11    sketch_components::sketch_components_impl(input)
12}
13
14/// **⚠️ Experimental** and **UNSTABLE**
15#[proc_macro_attribute]
16pub fn uniforms(attr: TokenStream, item: TokenStream) -> TokenStream {
17    uniforms::uniforms_impl(attr, item)
18}