From c96975b342bfe057fb50b7a3d833e10a28c83462 Mon Sep 17 00:00:00 2001 From: maciektr Date: Thu, 21 Mar 2024 18:43:07 +0100 Subject: [PATCH] Rename aux data collection to post processing commit-id:fbea0ed1 --- plugins/cairo-lang-macro-attributes/src/lib.rs | 4 ++-- scarb/src/compiler/plugin/proc_macro/host.rs | 2 +- scarb/tests/build_cairo_plugin.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/cairo-lang-macro-attributes/src/lib.rs b/plugins/cairo-lang-macro-attributes/src/lib.rs index 84005c412..821ee55ae 100644 --- a/plugins/cairo-lang-macro-attributes/src/lib.rs +++ b/plugins/cairo-lang-macro-attributes/src/lib.rs @@ -30,7 +30,7 @@ pub fn attribute_macro(_args: TokenStream, input: TokenStream) -> TokenStream { TokenStream::from(expanded) } -/// This macro can be used to construct the auxiliary data collection callback. +/// Constructs the post-processing callback. /// /// The procedural macro can emit additional auxiliary data alongside the generated [`TokenStream`] /// during the code expansion. This data can be used to collect additional information from the @@ -49,7 +49,7 @@ pub fn attribute_macro(_args: TokenStream, input: TokenStream) -> TokenStream { /// /// # Safety #[proc_macro_attribute] -pub fn aux_data_collection_callback(_args: TokenStream, input: TokenStream) -> TokenStream { +pub fn post_process(_args: TokenStream, input: TokenStream) -> TokenStream { let item: ItemFn = parse_macro_input!(input as ItemFn); let item = hide_name(item); let item_name = &item.sig.ident; diff --git a/scarb/src/compiler/plugin/proc_macro/host.rs b/scarb/src/compiler/plugin/proc_macro/host.rs index cd8143e95..dc569d084 100644 --- a/scarb/src/compiler/plugin/proc_macro/host.rs +++ b/scarb/src/compiler/plugin/proc_macro/host.rs @@ -185,7 +185,7 @@ impl ProcMacroHostPlugin { .into_group_map_by(|d| d.macro_id.package_id); for instance in self.macros.iter() { let _ = trace_span!( - "aux_data_collection_callback", + "post_process_callback", instance = %instance.package_id() ) .entered(); diff --git a/scarb/tests/build_cairo_plugin.rs b/scarb/tests/build_cairo_plugin.rs index a91c15455..d289037b1 100644 --- a/scarb/tests/build_cairo_plugin.rs +++ b/scarb/tests/build_cairo_plugin.rs @@ -462,7 +462,7 @@ fn can_return_aux_data_from_plugin() { simple_project_with_code( &t, indoc! {r##" - use cairo_lang_macro::{ProcMacroResult, TokenStream, attribute_macro, AuxData, aux_data_collection_callback}; + use cairo_lang_macro::{ProcMacroResult, TokenStream, attribute_macro, AuxData, post_process}; use serde::{Serialize, Deserialize}; #[derive(Debug, Serialize, Deserialize)] @@ -491,7 +491,7 @@ fn can_return_aux_data_from_plugin() { } } - #[aux_data_collection_callback] + #[post_process] pub fn callback(aux_data: Vec) { let aux_data = aux_data.into_iter() .map(|aux_data| {