Skip to content

Commit

Permalink
Rename aux data collection to post processing
Browse files Browse the repository at this point in the history
commit-id:fbea0ed1
  • Loading branch information
maciektr committed Mar 22, 2024
1 parent c07d9ae commit d4a1ff1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/cairo-lang-macro-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scarb/src/compiler/plugin/proc_macro/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions scarb/tests/build_cairo_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -491,7 +491,7 @@ fn can_return_aux_data_from_plugin() {
}
}
#[aux_data_collection_callback]
#[post_process]
pub fn callback(aux_data: Vec<AuxData>) {
let aux_data = aux_data.into_iter()
.map(|aux_data| {
Expand Down

0 comments on commit d4a1ff1

Please sign in to comment.