Skip to content

Commit

Permalink
Delete dead code
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
Keno committed Oct 21, 2017
1 parent 8d69e37 commit 1476f3f
Showing 1 changed file with 1 addition and 47 deletions.
48 changes: 1 addition & 47 deletions src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,6 @@ function _step_expr(frame, pc)
end
step_expr(frame) = _step_expr(frame, frame.pc)

function next_statement!(interp)
ind, node = interp.next_expr
move_past = ind[1]
while step_expr(interp)
ind, node = interp.next_expr
if ind[1] != move_past
return true
end
end
return false
end

function is_call(node)
isexpr(node, :call) ||
(isexpr(node, :(=)) && isexpr(node.args[2], :call))
Expand Down Expand Up @@ -226,38 +214,4 @@ function next_line!(frame, stack = nothing)
end
end
maybe_next_call!(frame, pc)
end

function advance_to_line(interp, line)
while true
at_line = determine_line_and_file(interp, idx_stack(interp))[1][2]
at_line == line && break
next_line!(interp) || break
end
end

function _evaluated!(interp, ret, wasstaged = false)
if wasstaged
# If this is the result of a staged function, we replace the argument
# the call rather than the call itself
ind, node = interp.next_expr
@assert isexpr(node, :call)
interp.shadowtree[[ind.idx_stack.stack; 1]] = (ret, AnnotationNode{Any}(true,AnnotationNode{Any}[]))
else
ind, node = interp.next_expr
interp.shadowtree[ind.idx_stack.stack] = (ret, AnnotationNode{Any}(true,AnnotationNode{Any}[]))
end
end
evaluated!(interp, ret, wasstaged = false) = (_evaluated!(interp, ret, wasstaged); done!(interp))

"""
Advance to the next evaluatable statement
"""
function done!(interp)
ind, node = interp.next_expr
# Skip evaluated values (e.g. constants)
while interp.shadowtree.shadow[ind.idx_stack.stack].val
ind, node = next_expr!(interp)
end
return true
end
end

0 comments on commit 1476f3f

Please sign in to comment.