(ctx: &mut Context, fdef: &FunctionDefinition)
| 214 | } |
| 215 | |
| 216 | fn write_function_def(ctx: &mut Context, fdef: &FunctionDefinition) -> String { |
| 217 | let fhandle = ctx.module.function_handle_at(fdef.function); |
| 218 | let parameters = &ctx.module.signature_at(fhandle.parameters).0; |
| 219 | let return_ = &ctx.module.signature_at(fhandle.return_).0; |
| 220 | format!( |
| 221 | " native {}{}fun {}{}({}){};", |
| 222 | write_visibility(fdef.visibility), |
| 223 | if fdef.is_entry { "entry " } else { "" }, |
| 224 | ctx.module.identifier_at(fhandle.name), |
| 225 | write_fun_type_parameters(&fhandle.type_parameters), |
| 226 | write_parameters(ctx, parameters), |
| 227 | write_return_type(ctx, return_) |
| 228 | ) |
| 229 | } |
| 230 | |
| 231 | fn write_visibility(visibility: Visibility) -> String { |
| 232 | match visibility { |
no test coverage detected