This code:
macro mymacro(ast)
println("ast outside = ", ast, "---\n")
:(function generated()
println("ast inside = ", $ast, "---\n")
end
)
end
@mymacro function func()
return 123
end
generated()
outputs:
ast outside = function func()
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:23 =#
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:24 =#
return 123
end—ast inside = #343#func—
How can I make it output
ast outside = function func()
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:23 =#
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:24 =#
return 123
end—ast inside = function func()
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:23 =#
#= /home/volker/Sync/DatenVolker/UNI/Masterarbeit/src/juliatest.jl:24 =#
return 123
end—