Skip to content

Commit

Permalink
Pass args to startup function (davidcole1340#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
joehoyle authored Feb 7, 2023
1 parent 831b3c8 commit 1875e99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/macros/src/startup_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ pub fn parser(args: Option<AttributeArgs>, input: ItemFn) -> Result<TokenStream>
let classes = build_classes(&state.classes)?;
let constants = build_constants(&state.constants);
let (before, after) = if args.before {
(Some(quote! { internal(); }), None)
(Some(quote! { internal(ty, module_number); }), None)
} else {
(None, Some(quote! { internal(); }))
(None, Some(quote! { internal(ty, module_number); }))
};

let func = quote! {
Expand All @@ -43,7 +43,7 @@ pub fn parser(args: Option<AttributeArgs>, input: ItemFn) -> Result<TokenStream>
use ::ext_php_rs::constant::IntoConst;
use ::ext_php_rs::flags::PropertyFlags;

fn internal() {
fn internal(ty: i32, module_number: i32) {
#(#stmts)*
}

Expand Down

0 comments on commit 1875e99

Please sign in to comment.