diff --git a/scarb/src/compiler/plugin/proc_macro/host.rs b/scarb/src/compiler/plugin/proc_macro/host.rs index 1b868e6db..0886abb81 100644 --- a/scarb/src/compiler/plugin/proc_macro/host.rs +++ b/scarb/src/compiler/plugin/proc_macro/host.rs @@ -1072,7 +1072,8 @@ impl InlineMacroExprPlugin for ProcMacroInlinePlugin { _metadata: &MacroPluginMetadata<'_>, ) -> InlinePluginResult { let stable_ptr = syntax.clone().stable_ptr().untyped(); - let token_stream = TokenStream::from_syntax_node(db, syntax); + let arguments = syntax.arguments(db); + let token_stream = TokenStream::from_syntax_node(db, &arguments); let result = self.instance().generate_code( self.expansion.name.clone(), TokenStream::empty(), diff --git a/scarb/tests/build_cairo_plugin.rs b/scarb/tests/build_cairo_plugin.rs index f71ebad0f..c93fb3b38 100644 --- a/scarb/tests/build_cairo_plugin.rs +++ b/scarb/tests/build_cairo_plugin.rs @@ -868,7 +868,8 @@ fn can_implement_inline_macro() { use cairo_lang_macro::{ProcMacroResult, TokenStream, inline_macro}; #[inline_macro] - pub fn some(_token_stream: TokenStream) -> ProcMacroResult { + pub fn some(token_stream: TokenStream) -> ProcMacroResult { + assert_eq!(token_stream.to_string(), "()"); ProcMacroResult::new(TokenStream::new("34".to_string())) } "##}) @@ -879,7 +880,10 @@ fn can_implement_inline_macro() { .version("1.0.0") .dep("some", &t) .lib_cairo(indoc! {r#" - fn main() -> felt252 { some!() } + fn main() -> felt252 { + let x = some!(); + x + } "#}) .build(&project);