File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,11 @@ function showprov(io::IO, exs::AbstractVector;
4747 print (io, " \n\n " )
4848 end
4949 k = kind (ex)
50- if isnothing (note) # use provided `note` otherwise
51- note = i > 1 && k == K " macrocall" ? " in macro expansion" :
52- i > 1 && k == K " $" ? " interpolated here" :
53- " in source"
54- end
55- highlight (io, sr; note= note, highlight_kwargs... )
50+ ex_note = ! isnothing (note) ? note :
51+ i > 1 && k == K " macrocall" ? " in macro expansion" :
52+ i > 1 && k == K " $" ? " interpolated here" :
53+ " in source"
54+ highlight (io, sr; note= ex_note, highlight_kwargs... )
5655
5756 if include_location
5857 line, _ = source_location (sr)
Original file line number Diff line number Diff line change 4747 end
4848 end
4949 # @ string:5"""
50+ @test sprint (io-> showprov (io, ex[1 ][3 ]; note= " foo" )) == raw """
51+ begin
52+ x = 10
53+ y = :(g(z))
54+ # └──┘ ── foo
55+ quote
56+ f($(x+1), $y)
57+ # @ string:3
58+
59+ y = :(g(z))
60+ quote
61+ f($(x+1), $y)
62+ # └┘ ── foo
63+ end
64+ end
65+ # @ string:5"""
5066
5167
5268# Test expression flags are preserved during interpolation
You can’t perform that action at this time.
0 commit comments