pub fn write_replaced_function(&mut self) -> String {
        // Construct the argument list (e.g., int _1, float* _2, ..)
        let argument_list = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, arg)| format!("{} _{}", arg.0, i));
        let argument_list = join("", ",", argument_list);

        // Constructs a list of arguments passed to a function call (e.g., _1, _2, ..)
        let function_call_args = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, _arg)| format!("_{}", i));
        let function_call_args = join("", ",", function_call_args);

        // Construct assignments from the arguments to the struct (e.g., v._1 = _1;)
        let argstruct_construct_list = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, _)| format!("v._{} = _{};", i, i));
        let argstruct_construct_list = join("", "\n", argstruct_construct_list);

        let (return_tag, has_return_value, register_return) = if self.annotation.function.is_void() {
            ("", "0", "")
        } else {
            ("return", "1", "intptr_t tag = ")
        };

        let return_line = if self.annotation.function.is_void() {
            "".to_string()
        } else {
            format!("return ({})(tag);", self.annotation.function.return_type)
        };

        format!(
            include_str!("resources/function.c.template"),
            prefix=&self.prefix,
            argument_list=argument_list,
            function_call_args=function_call_args,
            return_type=self.annotation.function.return_type,
            return_tag=return_tag,
            has_return_value=has_return_value,
            register_return=register_return,
            return_line=return_line,
            function_name=self.annotation.function.func_name,
            argstruct_construct_list=argstruct_construct_list
        )
    }
/// Writes the replacement function that users of this header should call.
Writes the replacement function that users of this header should call.
Writes the replacement function that users of this header should call .
pub fn write_replaced_function(&mut self) -> String {
        // Construct the argument list (e.g., int _1, float* _2, ..)
        let argument_list = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, arg)| format!("{} _{}", arg.0, i));
        let argument_list = join("", ",", argument_list);
        // Constructs a list of arguments passed to a function call (e.g., _1, _2, ..)
        let function_call_args = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, _arg)| format!("_{}", i));
        let function_call_args = join("", ",", function_call_args);
        // Construct assignments from the arguments to the struct (e.g., v._1 = _1;)
        let argstruct_construct_list = self.annotation.function.arguments.iter()
            .enumerate()
            .map(|(i, _)| format!("v._{} = _{};", i, i));
        let argstruct_construct_list = join("", "\n", argstruct_construct_list);
        let (return_tag, has_return_value, register_return) = if self.annotation.function.is_void() {
            ("", "0", "")
        } else {
            ("return", "1", "intptr_t tag = ")
        };
        let return_line = if self.annotation.function.is_void() {
            "".to_string()
        } else {
            format!("return ({})(tag);", self.annotation.function.return_type)
        };
        format!(
            include_str!("resources/function.c.template"),
            prefix=&self.prefix,
            argument_list=argument_list,
            function_call_args=function_call_args,
            return_type=self.annotation.function.return_type,
            return_tag=return_tag,
            has_return_value=has_return_value,
            register_return=register_return,
            return_line=return_line,
            function_name=self.annotation.function.func_name,
            argstruct_construct_list=argstruct_construct_list
        )
    }
pub fn write_replaced_function ( & mut self ) -> String { // Construct the argument list (e.g., int _1, float* _2, ..) let argument_list = self . annotation . function . arguments . iter ( ) . enumerate ( ) . map ( | ( i , arg ) | format ! ( " " arg 0 i ) ) ; let argument_list = join ( " " , " " , argument_list ) ; // Constructs a list of arguments passed to a function call (e.g., _1, _2, ..) let function_call_args = self . annotation . function . arguments . iter ( ) . enumerate ( ) . map ( | ( i , _arg ) | format ! ( " " i ) ) ; let function_call_args = join ( " " , " " , function_call_args ) ; // Construct assignments from the arguments to the struct (e.g., v._1 = _1;) let argstruct_construct_list = self . annotation . function . arguments . iter ( ) . enumerate ( ) . map ( | ( i , _ ) | format ! ( " " i i ) ) ; let argstruct_construct_list = join ( " " , " \n " , argstruct_construct_list ) ; let ( return_tag , has_return_value , register_return ) = if self . annotation . function . is_void ( ) { ( " " , " " , " " ) } else { ( " " , " " , " " ) } ; let return_line = if self . annotation . function . is_void ( ) { " " . to_string ( ) } else { format ! ( " " self annotation function return_type ) } ; format ! ( include_str ( " " ) prefix self prefix argument_list argument_list function_call_args function_call_args return_type self annotation function return_type return_tag return_tag has_return_value has_return_value register_return register_return return_line return_line function_name self annotation function func_name argstruct_construct_list argstruct_construct_list ) }
Writes the replacement function that users of this header should call.
Writes the replacement function that users of this header should call .
&mut self