Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename aux data collection to post processing #1214

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading