Skip to content

Commit

Permalink
Clean up dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Apr 22, 2021
1 parent 6819f18 commit 683f199
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function _parse_vars(macroname, type, x, transform=identity)
x = flatten_expr!(x)
cursor = 0
isoption(ex) = Meta.isexpr(ex, [:vect, :vcat, :hcat])
runtime_vals = Dict()
while cursor < length(x)
cursor += 1
v = x[cursor]
Expand Down Expand Up @@ -136,9 +135,9 @@ function _parse_vars(macroname, type, x, transform=identity)
if iscall
isruntime, fname = unwrap_runtime_var(v.args[1])
call_args = map(lastunwrap_runtime_var, @view v.args[2:end])
var_name, expr = construct_vars!(runtime_vals, fname, type, call_args, val, options, transform, isruntime)
var_name, expr = construct_vars(fname, type, call_args, val, options, transform, isruntime)
else
var_name, expr = construct_vars!(runtime_vals, v, type, nothing, val, options, transform, isruntime)
var_name, expr = construct_vars(v, type, nothing, val, options, transform, isruntime)
end

push!(var_names, var_name)
Expand All @@ -149,7 +148,7 @@ function _parse_vars(macroname, type, x, transform=identity)
return ex
end

function construct_vars!(runtime_vals, v, type, call_args, val, prop, transform, isruntime)
function construct_vars(v, type, call_args, val, prop, transform, isruntime)
issym = v isa Symbol
isarray = isa(v, Expr) && v.head == :ref
if isarray
Expand All @@ -163,7 +162,6 @@ function construct_vars!(runtime_vals, v, type, call_args, val, prop, transform,
end
rhs = transform(expr)
lhs = isruntime ? gensym(var_name) : var_name
runtime_vals[var_name] = lhs
lhs, :($lhs = $rhs)
end

Expand Down

0 comments on commit 683f199

Please sign in to comment.