mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-12-02 09:37:51 +01:00
Pass args to startup function (#226)
This commit is contained in:
parent
831b3c8597
commit
1875e99e93
@ -32,9 +32,9 @@ pub fn parser(args: Option<AttributeArgs>, input: ItemFn) -> Result<TokenStream>
|
|||||||
let classes = build_classes(&state.classes)?;
|
let classes = build_classes(&state.classes)?;
|
||||||
let constants = build_constants(&state.constants);
|
let constants = build_constants(&state.constants);
|
||||||
let (before, after) = if args.before {
|
let (before, after) = if args.before {
|
||||||
(Some(quote! { internal(); }), None)
|
(Some(quote! { internal(ty, module_number); }), None)
|
||||||
} else {
|
} else {
|
||||||
(None, Some(quote! { internal(); }))
|
(None, Some(quote! { internal(ty, module_number); }))
|
||||||
};
|
};
|
||||||
|
|
||||||
let func = quote! {
|
let func = quote! {
|
||||||
@ -43,7 +43,7 @@ pub fn parser(args: Option<AttributeArgs>, input: ItemFn) -> Result<TokenStream>
|
|||||||
use ::ext_php_rs::constant::IntoConst;
|
use ::ext_php_rs::constant::IntoConst;
|
||||||
use ::ext_php_rs::flags::PropertyFlags;
|
use ::ext_php_rs::flags::PropertyFlags;
|
||||||
|
|
||||||
fn internal() {
|
fn internal(ty: i32, module_number: i32) {
|
||||||
#(#stmts)*
|
#(#stmts)*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user