make wiggle-generate ordinary lib, and wiggle the proc-macro lib
this allows us to reuse the code in wiggle-generate elsewhere, because a proc-macro=true lib can only export a #[proc_macro] and not ordinary functions. In lucet, I will depend on wiggle-generate to define a proc macro that glues wiggle to the specifics of the runtime.
This commit is contained in:
13
src/lib.rs
13
src/lib.rs
@@ -1,5 +1,10 @@
|
||||
/*
|
||||
pub mod wasi {
|
||||
generate::from_witx!("crates/WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx");
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
use syn::parse_macro_input;
|
||||
|
||||
#[proc_macro]
|
||||
pub fn from_witx(args: TokenStream) -> TokenStream {
|
||||
let config = parse_macro_input!(args as wiggle_generate::Config);
|
||||
TokenStream::from(wiggle_generate::generate(config))
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user