Skip to content

Commit 1d87867

Browse files
authored
Update some failing doctests (#579)
1 parent 43f2041 commit 1d87867

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

.github/workflows/Documenter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
name: Documentation
1111
runs-on: ubuntu-latest
1212
steps:
13+
- uses: julia-actions/setup-julia@v1
14+
with:
15+
version: '1'
16+
show-versioninfo: true # print versioninfo in the action log
1317
- uses: actions/checkout@v2
1418
- uses: julia-actions/julia-buildpkg@latest
1519
- uses: julia-actions/julia-docdeploy@latest

docs/src/index.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ globally-available name (as used here with the `any` function).
4848

4949
Now let's see what happens:
5050

51-
```jldoctest demo1; filter = [r"in Base at .*$", r"[^\d]\d\d\d[^\d]"]
51+
```jldoctest demo1; filter = [r"in Base at .*$", r"[^\d]\d\d\d[^\d]", r"(c 1|d 1)"]
5252
julia> @interpret sum([1,2,3]) # no element bigger than 4, breakpoint should not trigger
5353
6
5454
5555
julia> frame, bpref = @interpret sum([1,2,5]) # should trigger breakpoint
56-
(Frame for sum(a::AbstractArray; dims, kw...) in Base at reducedim.jl:873
57-
c 1* 873 1 ─ nothing
58-
2 873 │ %2 = ($(QuoteNode(NamedTuple)))()
59-
3 873 │ %3 = Base.pairs(%2)
56+
(Frame for sum(a::AbstractArray; dims, kw...) @ Base reducedim.jl:994
57+
c 1* 994 1 ─ nothing
58+
2 994 │ %2 = $(QuoteNode(Colon()))
59+
3 994 │ %3 = ($(QuoteNode(NamedTuple)))()
6060
61-
a = [1, 2, 5], breakpoint(sum(a::AbstractArray; dims, kw...) in Base at reducedim.jl:873, line 873))
61+
a = [1, 2, 5], breakpoint(sum(a::AbstractArray; dims, kw...) @ Base reducedim.jl:994, line 994))
6262
```
6363

6464
`frame` is described in more detail on the next page; for now, suffice it to say
6565
that the `c` in the leftmost column indicates the presence of a conditional breakpoint
6666
upon entry to `sum`. `bpref` is a reference to the breakpoint of type [`BreakpointRef`](@ref).
6767
The breakpoint `bp` we created can be manipulated at the command line
6868

69-
```jldoctest demo1; filter = [r"in Base at .*$", r"[^\d]\d\d\d[^\d]"]
69+
```jldoctest demo1; filter = [r"in Base at .*$", r"[^\d]\d\d\d[^\d]", r"(c 1|d 1)"]
7070
julia> disable(bp)
7171
7272
julia> @interpret sum([1,2,5])
@@ -75,12 +75,12 @@ julia> @interpret sum([1,2,5])
7575
julia> enable(bp)
7676
7777
julia> @interpret sum([1,2,5])
78-
(Frame for sum(a::AbstractArray; dims, kw...) in Base at reducedim.jl:873
79-
c 1* 873 1 ─ nothing
80-
2 873 │ %2 = ($(QuoteNode(NamedTuple)))()
81-
3 873 │ %3 = Base.pairs(%2)
78+
(Frame for sum(a::AbstractArray; dims, kw...) @ Base reducedim.jl:994
79+
c 1* 994 1 ─ nothing
80+
2 994 │ %2 = $(QuoteNode(Colon()))
81+
3 994 │ %3 = ($(QuoteNode(NamedTuple)))()
8282
83-
a = [1, 2, 5], breakpoint(sum(a::AbstractArray; dims, kw...) in Base at reducedim.jl:873, line 873))
83+
a = [1, 2, 5], breakpoint(sum(a::AbstractArray; dims, kw...) @ Base reducedim.jl:994, line 994))
8484
```
8585

8686
[`disable`](@ref) and [`enable`](@ref) allow you to turn breakpoints off and on without losing any
@@ -109,20 +109,20 @@ julia> break_on(:error)
109109
110110
julia> fr, pc = @interpret f_outer()
111111
before error
112-
(Frame for f_outer() in Main at none:1
112+
(Frame for f_outer() @ Main none:1
113113
1 2 1 ─ Base.println("before error")
114114
2* 3 │ f_inner()
115115
3 4 │ %3 = Base.println("after error")
116116
4 4 └── return %3
117-
callee: f_inner() in Main at none:1, breakpoint(error(s::AbstractString) in Base at error.jl:35, line 35, ErrorException("inner error")))
117+
callee: f_inner() @ Main none:1, breakpoint(error(s::AbstractString) @ Base error.jl:35, line 35, ErrorException("inner error")))
118118
119119
julia> leaf(fr)
120-
Frame for error(s::AbstractString) in Base at error.jl:35
120+
Frame for error(s::AbstractString) @ Base error.jl:35
121121
1 35 1 ─ %1 = ($(QuoteNode(ErrorException)))(s)
122122
2* 35 │ %2 = Core.throw(%1)
123123
3 35 └── return %2
124124
s = "inner error"
125-
caller: f_inner() in Main at none:1
125+
caller: f_inner() @ Main none:1
126126
127127
julia> typeof(pc)
128128
BreakpointRef
@@ -154,7 +154,7 @@ julia> @interpret myfunction(1, 2)
154154
6
155155
156156
julia> @interpret myfunction(5, 6)
157-
(Frame for myfunction(x, y) in Main at none:1
157+
(Frame for myfunction(x, y) @ Main none:1
158158
159159
3 4 │ %3 = x > 3
160160
4 4 └── goto #3 if not %3
@@ -165,7 +165,7 @@ b 5* 4 2 ─ nothing
165165
x = 5
166166
y = 6
167167
b = 2
168-
a = 1, breakpoint(myfunction(x, y) in Main at none:1, line 4))
168+
a = 1, breakpoint(myfunction(x, y) @ Main none:1, line 4))
169169
```
170170

171171
Here the breakpoint is marked with a `b` indicating that it is an unconditional breakpoint.

src/construct.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ julia> JuliaInterpreter.prepare_args(mymethod, [mymethod, 15], ())
126126
(mymethod, Any[mymethod, 15])
127127
128128
julia> JuliaInterpreter.prepare_args(mymethod, [mymethod, 1, 2], [:verbose=>true])
129-
(var"#mymethod##kw"(), Any[var"#mymethod##kw"(), (verbose = true,), mymethod, 1, 2])
129+
(Core.kwcall, Any[Core.kwcall, (verbose = true,), mymethod, 1, 2])
130130
```
131131
"""
132132
function prepare_args(@nospecialize(f), allargs, kwargs)
@@ -592,7 +592,7 @@ julia> mymethod(x) = x+1
592592
mymethod (generic function with 1 method)
593593
594594
julia> JuliaInterpreter.enter_call_expr(:(\$mymethod(1)))
595-
Frame for mymethod(x) in Main at none:1
595+
Frame for mymethod(x) @ Main none:1
596596
1* 1 1 ─ %1 = x + 1
597597
2 1 └── return %1
598598
x = 1
@@ -606,7 +606,7 @@ julia> a = [1.0, 2.0]
606606
2.0
607607
608608
julia> JuliaInterpreter.enter_call_expr(:(\$mymethod(\$a)))
609-
Frame for mymethod(x::Vector{T}) where T in Main at none:1
609+
Frame for mymethod(x::Vector{T}) where T @ Main none:1
610610
1* 1 1 ─ return 1
611611
x = [1.0, 2.0]
612612
T = Float64
@@ -635,7 +635,7 @@ julia> mymethod(x) = x+1
635635
mymethod (generic function with 1 method)
636636
637637
julia> JuliaInterpreter.enter_call(mymethod, 1)
638-
Frame for mymethod(x) in Main at none:1
638+
Frame for mymethod(x) @ Main none:1
639639
1* 1 1 ─ %1 = x + 1
640640
2 1 └── return %1
641641
x = 1
@@ -644,7 +644,7 @@ julia> mymethod(x::Vector{T}) where T = 1
644644
mymethod (generic function with 2 methods)
645645
646646
julia> JuliaInterpreter.enter_call(mymethod, [1.0, 2.0])
647-
Frame for mymethod(x::Vector{T}) where T in Main at none:1
647+
Frame for mymethod(x::Vector{T}) where T @ Main none:1
648648
1* 1 1 ─ return 1
649649
x = [1.0, 2.0]
650650
T = Float64

0 commit comments

Comments
 (0)