From ffbf5be667f8958c7670d08ec6c458f0fb927b2a Mon Sep 17 00:00:00 2001 From: Melven Roehrig-Zoellner Date: Wed, 20 Dec 2023 19:10:45 +0100 Subject: [PATCH] docstring support for functions --- src/CxxWrap.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CxxWrap.jl b/src/CxxWrap.jl index de2d5a1..59a752a 100644 --- a/src/CxxWrap.jl +++ b/src/CxxWrap.jl @@ -304,6 +304,7 @@ mutable struct CppFunctionInfo function_pointer::Ptr{Cvoid} thunk_pointer::Ptr{Cvoid} override_module::Module + doc::Any end # Interpreted as a constructor for Julia > 0.5 @@ -646,6 +647,12 @@ function build_function_expression(func::CppFunctionInfo, funcidx, julia_mod) end function_expression = :($(make_func_declaration((func.name,func.override_module), argmap(argtypes), julia_mod))::$(map_julia_return_type(func.julia_return_type)) = $call_exp) + + if func.doc != "" + function_expression = :(Core.@doc $(func.doc) $function_expression) + println(function_expression) + end + return function_expression end