Skip to content

Commit

Permalink
docstring support for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
melven committed Dec 20, 2023
1 parent bbddc3f commit ffbf5be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/CxxWrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ffbf5be

Please sign in to comment.