1
2
3
4
5
6
7
8
9
10
11
12
extern crate proc_macro;
mod renderer;
use quote::quote;

#[proc_macro]
pub fn platform_gate(_input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    if !_input.is_empty() {
        panic!("`platform_gate!()` macro takes no arguments");
    }
    let code = renderer::PlatformGate::new();
    proc_macro::TokenStream::from(quote! {#code})
}