Expronicon.jl icon indicating copy to clipboard operation
Expronicon.jl copied to clipboard

Support $ interpolation when parsing docstrings for JLFunction

Open 0x0f0f0f opened this issue 7 months ago • 1 comments

julia> :("foo")
"foo"

julia> bar = 42
42

julia> :("foo $bar")
:("foo $(bar)")

julia> dump(ans)
Expr
  head: Symbol string
  args: Array{Any}((2,))
    1: String "foo "
    2: Symbol bar

julia> ex = quote
       "foo $bar" 
       f(x) = x+1
       end;

julia> JLFunction(ex)
ERROR: MethodError: Cannot `convert` an object of type Expr to an object of type String

How to do that? We can simply change doc::Maybe{String} to doc::Maybe{Union{String, Expr}}.

0x0f0f0f avatar Jul 18 '24 14:07 0x0f0f0f