Skip to content

Commit 43f0215

Browse files
committed
rm gen_lookup_ex, and fix @lookup
1 parent 0be2e0d commit 43f0215

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/interpret.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,15 @@ function lookup(frame::Frame, @nospecialize(node))
3636
end
3737
end
3838

39-
function gen_lookup_ex(frame, node)
40-
:(let node = $(esc(node))
41-
isa(node, SSAValue) ? lookup_var($(esc(frame)), node) :
42-
isa(node, GlobalRef) ? lookup_var($(esc(frame)), node) :
43-
isa(node, SlotNumber) ? lookup_var($(esc(frame)), node) :
44-
isa(node, QuoteNode) ? node.value :
45-
isa(node, Symbol) ? @invokelatest(getglobal(moduleof($(esc(frame))), node)) :
46-
isa(node, Expr) ? lookup_expr($(esc(frame)), node) :
47-
node # fallback
48-
end)
49-
end
5039
macro lookup(frame, node)
40+
f, l = __source__.file, __source__.line
5141
@warn "`@lookup` at $f:$l is deprecated, use `lookup(frame, node)` instead."
52-
return gen_lookup_ex(frame, node)
42+
return :(lookup($(esc(frame)), $(esc(node))))
5343
end
5444
macro lookup(_, frame, node)
5545
f, l = __source__.file, __source__.line
5646
@warn "`@lookup(mod, frame, node)` at $f:$l is deprecated, use `lookup(frame, node)` instead."
57-
return gen_lookup_ex(frame, node)
47+
return :(lookup($(esc(frame)), $(esc(node))))
5848
end
5949

6050
function lookup_expr(frame::Frame, e::Expr)

0 commit comments

Comments
 (0)