use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, ItemFn};
#[proc_macro_attribute]
pub fn main(_: TokenStream, input: TokenStream) -> TokenStream {
let input_fn = parse_macro_input!(input as ItemFn);
let fn_name = input_fn.sig.ident.clone();
let output = quote! {
#[export_name = "kernel_run"]
pub extern "C" fn kernel_run() {
let mut runtime = rock_n_rollup::core::KernelRuntime::default();
let mut app = rock_n_rollup::core::Application::new(&mut runtime);
#fn_name(&mut app);
}
#input_fn
};
output.into()
}