Closed mossr closed 3 years ago
I'm able to reproduce this issue and can confirm that v0.9.4 works.
Seems like this line (which was introduced after v0.10) is the issue: https://github.com/JunoLab/Weave.jl/blob/174585e5044814a5c1752d9b0184111f38521fd4/src/run.jl#L227
include_string
doesn't respect ;
, e.g.
julia> include_string(Main, "1 + 2;")
3
@torfjelde thanks for tracking the problem. I introduced include_string
in this commit just because it's easier way to respect filename and line numbers than to use Core.eval
solution (, which needs bit of expression manipulation).
I feel a special casing that adds ; nothing
when the input line ends with semicolon would be enough for handling this bug.
How about https://github.com/JunoLab/Weave.jl/blob/174585e5044814a5c1752d9b0184111f38521fd4/src/run.jl#L227-L228 becomes
obj = include_string(mod, code, path) # TODO: fix line number
!isnothing(obj) && !REPL.ends_with_semicolon(code) && display(obj)
?
ah sounds nice. wanna open a PR ?
Sure thing :+1:
will be fixed in v0.10.4
When using the
juliaconsole
environment from pythontex, semicolons no longer suppress outputs in Weave versions 0.10+ (v0.9.4 is the last working version).Any pointers to help track this down, I'd be happy to help get this fixed.