Skip to content

Commit 2f5a96f

Browse files
authored
rename location to linenumber (#50)
1 parent bf27cba commit 2f5a96f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/interpret.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,18 +613,18 @@ end
613613

614614
isgotonode(node) = isa(node, GotoNode) || isexpr(node, :gotoifnot)
615615

616-
location(frame) = location(frame, frame.pc[])
617-
function location(frame, pc)
616+
linenumber(frame) = linenumber(frame, frame.pc[])
617+
function linenumber(frame, pc)
618618
codeloc = frame.code.code.codelocs[pc.next_stmt]
619619
return frame.code.scope isa Method ?
620620
frame.code.code.linetable[codeloc].line :
621621
codeloc
622622
end
623623
function next_line!(stack, frame, dbstack = nothing)
624-
initial = location(frame)
624+
initial = linenumber(frame)
625625
first = true
626626
pc = frame.pc[]
627-
while location(frame, pc) == initial
627+
while linenumber(frame, pc) == initial
628628
# If this is a return node, interrupt execution. This is the same
629629
# special case as in `s`.
630630
expr = pc_expr(frame, pc)

test/interpret.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,6 @@ function f(x)
211211
return x*x
212212
end
213213
frame = JuliaInterpreter.enter_call(f, 3)
214-
@test JuliaInterpreter.location(frame, JuliaInterpreter.JuliaProgramCounter(1)) == defline + 1
215-
@test JuliaInterpreter.location(frame, JuliaInterpreter.JuliaProgramCounter(3)) == defline + 4
216-
@test JuliaInterpreter.location(frame, JuliaInterpreter.JuliaProgramCounter(5)) == defline + 6
214+
@test JuliaInterpreter.linenumber(frame, JuliaInterpreter.JuliaProgramCounter(1)) == defline + 1
215+
@test JuliaInterpreter.linenumber(frame, JuliaInterpreter.JuliaProgramCounter(3)) == defline + 4
216+
@test JuliaInterpreter.linenumber(frame, JuliaInterpreter.JuliaProgramCounter(5)) == defline + 6

0 commit comments

Comments
 (0)