diff --git a/crates/guest-rust-macro/src/lib.rs b/crates/guest-rust-macro/src/lib.rs index 92e2f763a..0d8704473 100644 --- a/crates/guest-rust-macro/src/lib.rs +++ b/crates/guest-rust-macro/src/lib.rs @@ -15,6 +15,7 @@ mod kw { syn::custom_keyword!(unchecked); syn::custom_keyword!(no_std); syn::custom_keyword!(raw_strings); + syn::custom_keyword!(macro_export); syn::custom_keyword!(macro_call_prefix); syn::custom_keyword!(export_macro_name); syn::custom_keyword!(skip); @@ -24,6 +25,7 @@ enum Opt { Unchecked, NoStd, RawStrings, + MacroExport, MacroCallPrefix(LitStr), ExportMacroName(LitStr), Skip(Vec), @@ -41,6 +43,9 @@ impl Parse for Opt { } else if l.peek(kw::raw_strings) { input.parse::()?; Ok(Opt::RawStrings) + } else if l.peek(kw::macro_export) { + input.parse::()?; + Ok(Opt::MacroExport) } else if l.peek(kw::macro_call_prefix) { input.parse::()?; input.parse::()?; @@ -68,6 +73,7 @@ impl wit_bindgen_rust_macro_shared::Configure for Opt { Opt::Unchecked => opts.unchecked = true, Opt::NoStd => opts.no_std = true, Opt::RawStrings => opts.raw_strings = true, + Opt::MacroExport => opts.macro_export = true, Opt::MacroCallPrefix(prefix) => opts.macro_call_prefix = Some(prefix.value()), Opt::ExportMacroName(name) => opts.export_macro_name = Some(name.value()), Opt::Skip(list) => opts.skip.extend(list.iter().map(|i| i.value())),