Skip to content

Commit 6546d85

Browse files
committed
Add docs, fix REPL&Revise
1 parent 29be602 commit 6546d85

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ jobs:
4949
TERM="xterm" julia --project -i --code-coverage -e '
5050
using InteractiveUtils, REPL, Revise, Pkg
5151
Pkg.add("ColorTypes")
52-
@async(Base.run_main_repl(true, true, false, true, false))
53-
sleep(2)
52+
t = @async(
53+
VERSION >= v"1.12.0-DEV.612" ? Base.run_main_repl(true, true, :no, true) :
54+
VERSION >= v"1.11.0-DEV.222" ? Base.run_main_repl(true, true, :no, true, false) :
55+
Base.run_main_repl(true, true, false, true, false))
56+
isdefined(Base, :errormonitor) && Base.errormonitor(t)
57+
while (!isdefined(Base, :active_repl_backend) || isnothing(Base.active_repl_backend)) sleep(0.1) end
58+
pushfirst!(Base.active_repl_backend.ast_transforms, Revise.revise_first)
5459
cd("test")
5560
include("runtests.jl")
5661
if Base.VERSION.major == 1 && Base.VERSION.minor >= 9

src/utils.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ else
210210
return [iszero(cl[pc]) ? Core.LineInfoNode[] : [lt[cl[pc]]] for pc = eachindex(cl)]
211211
end
212212
end
213+
@doc """
214+
scopes = linetable_scopes(m::Method)
215+
216+
Return an array of "scopes" for each statement in the lowered code for `m`.
217+
If `src = Base.uncompressed_ast(m)`, then `scopes[pc]` is an vector of `LineInfoNode`
218+
objects that represent the scopes active at the statement at position `pc` in `src.code`.
219+
220+
On Julia 1.12 and later, `scopes[pc]` may have length larger than 1, where the first entry
221+
is for the source location in `m`, and any later entries reflect code from inlining.
222+
It will be a vector of `Base.Compiler.IRShow.LineInfoNode` objects.
223+
224+
Prior to Julia 1.12, `scopes[pc]` will have length 1, and will be a vector of `Core.LineInfoNode`
225+
objects (which have more fields than `Base.Compiler.IRShow.LineInfoNode`). It will represent
226+
the final stage of inlining for the statement at position `pc` in `src.code`.
227+
""" linetable_scopes
213228

214229
getmethod(m::Method) = m
215230
getmethod(mi::Core.MethodInstance) = getmethod(mi.def)

0 commit comments

Comments
 (0)