fn collect_call(args: &Vec<TransformedArg>) -> proc_macro2::TokenStream {
    //  Construct a new `TokenStream` to accumulate the expanded code.
    //  We use `TokenStream` instead of string because `TokenStream` remembers the source location (span) in case of errors.
    //  `quote!` returns `proc_macro2::TokenStream` instead of `proc_macro::TokenStream`, so we use `proc_macro2::TokenStream`.
    let mut expanded = proc_macro2::TokenStream::new();
    for arg in args {
        //  Construct the call expr and type tokens, preserving the span: `t as *mut os_task`
        let TransformedArg{ call_expr, extern_type, ident_span, type_span, .. } = arg;
        let tokens = expand_decl(call_expr, extern_type, ident_span, type_span, Separator::As);
        if !expanded.is_empty() { expanded.extend(quote!{ , }) }  //  Add a comma if not first arg.
        expanded.extend(tokens);
    }
    //  Return the expanded tokens.
    //  println!("expanded: {:#?}", expanded);
    expanded
}
/// Collect the Call Expressions for all args. Return a TokenStream of the call expressions for the wrapper function:
/// `t, name.bytestr.as_ptr() as *const ::cty::c_char, ...`
/// Preserve the span info for error display.
Collect the Call Expressions for all args.
Collect the Call Expressions for all args .
fn collect_call(args: &Vec<TransformedArg>) -> proc_macro2::TokenStream {
    //  Construct a new `TokenStream` to accumulate the expanded code.
    //  We use `TokenStream` instead of string because `TokenStream` remembers the source location (span) in case of errors.
    //  `quote!` returns `proc_macro2::TokenStream` instead of `proc_macro::TokenStream`, so we use `proc_macro2::TokenStream`.
    let mut expanded = proc_macro2::TokenStream::new();
    for arg in args {
        //  Construct the call expr and type tokens, preserving the span: `t as *mut os_task`
        let TransformedArg{ call_expr, extern_type, ident_span, type_span, .. } = arg;
        let tokens = expand_decl(call_expr, extern_type, ident_span, type_span, Separator::As);
        if !expanded.is_empty() { expanded.extend(quote!{ , }) }  //  Add a comma if not first arg.
        expanded.extend(tokens);
    }
    //  Return the expanded tokens.
    //  println!("expanded: {:#?}", expanded);
    expanded
}
fn collect_call ( args : & Vec < TransformedArg > ) -> proc_macro2 :: TokenStream { //  Construct a new `TokenStream` to accumulate the expanded code. //  We use `TokenStream` instead of string because `TokenStream` remembers the source location (span) in case of errors. //  `quote!` returns `proc_macro2::TokenStream` instead of `proc_macro::TokenStream`, so we use `proc_macro2::TokenStream`. let mut expanded = proc_macro2 :: TokenStream :: new ( ) ; for arg in args { //  Construct the call expr and type tokens, preserving the span: `t as *mut os_task` let TransformedArg { call_expr , extern_type , ident_span , type_span , .. } = arg ; let tokens = expand_decl ( call_expr , extern_type , ident_span , type_span , Separator :: As ) ; if ! expanded . is_empty ( ) { expanded . extend ( quote ! { } ) } //  Add a comma if not first arg. expanded . extend ( tokens ) ; } //  Return the expanded tokens. //  println!("expanded: {:#?}", expanded); expanded }
Collect the Call Expressions for all args.
Collect the Call Expressions for all args .
args
&Vec<TransformedArg>
args
&Vec<TransformedArg>