We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
codeloc==0
linenumber
1 parent a4ae7bf commit 209fd47Copy full SHA for 209fd47
src/interpret.jl
@@ -613,13 +613,19 @@ end
613
614
isgotonode(node) = isa(node, GotoNode) || isexpr(node, :gotoifnot)
615
616
-linenumber(frame) = linenumber(frame, frame.pc[])
617
-function linenumber(frame, pc)
+"""
+ linenumber(frame, pc=frame.pc[])
618
+
619
+Return line number for `frame` at `pc` or `nothing` if it cannot be determined.
620
621
+function linenumber(frame, pc=frame.pc[])
622
codeloc = frame.code.code.codelocs[pc.next_stmt]
623
+ codeloc == 0 && return nothing
624
return frame.code.scope isa Method ?
625
frame.code.code.linetable[codeloc].line :
626
codeloc
627
end
628
629
function next_line!(stack, frame, dbstack = nothing)
630
initial = linenumber(frame)
631
first = true
0 commit comments