Skip to content

Commit f1af5a0

Browse files
committed
tidy
1 parent fa1a8d2 commit f1af5a0

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/references.jl

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ function initial_pass_on_exports(x::EXPR, name, server)
144144
for a in x.args[3] # module block expressions
145145
if headof(a) === :export
146146
for i = 1:length(a.args)
147-
if isidentifier(a.args[i]) && valof(a.args[i]) == name
148-
if !hasref(a.args[i])
149-
Delayed(scopeof(x), server)(a.args[i])
150-
end
147+
if isidentifier(a.args[i]) && valof(a.args[i]) == name && !hasref(a.args[i])
148+
Delayed(scopeof(x), server)(a.args[i])
151149
end
152150
end
153151
end
@@ -220,12 +218,11 @@ function resolve_getfield(x::EXPR, b::Binding, state::State)::Bool
220218
end
221219

222220
function resolve_getfield(x::EXPR, parent_type, state::State)::Bool
223-
hasref(x) && return true
224-
return false
221+
hasref(x)
225222
end
226223

227224
function is_overloaded(val::SymbolServer.SymStore, scope::Scope)
228-
(vr = val.name isa SymbolServer.FakeTypeName ? val.name.name : val.name)
225+
vr = val.name isa SymbolServer.FakeTypeName ? val.name.name : val.name
229226
haskey(scope.overloaded, vr)
230227
end
231228

@@ -257,15 +254,6 @@ function resolve_getfield(x::EXPR, m::SymbolServer.ModuleStore, state::State)::B
257254
return resolved
258255
end
259256

260-
# function is_overloaded1(x, tls, val)
261-
# vr = val.name isa SymbolServer.FakeTypeName ? val.name.name : val.name
262-
# if haskey(tls.names, valof(x)) && tls.names[valof(x)] isa Binding && first(tls.names[valof(x)]) isa SymbolServer.FunctionStore
263-
264-
# end
265-
# haskey(tls.overloaded, vr)
266-
267-
# end
268-
269257
function resolve_getfield(x::EXPR, parent::SymbolServer.DataTypeStore, state::State)::Bool
270258
hasref(x) && return true
271259
resolved = false
@@ -298,4 +286,4 @@ new_within_struct(x::EXPR)
298286
Checks whether x is a reference to `new` within a datatype constructor.
299287
"""
300288
new_within_struct(x::EXPR) = isidentifier(x) && valofid(x) == "new" && is_in_fexpr(x, CSTParser.defines_struct)
301-
is_special_macro_term(x::EXPR) = isidentifier(x) && (valofid(x) == "__source__" || valofid(x) == "__module__") && is_in_fexpr(x, CSTParser.defines_macro)
289+
is_special_macro_term(x::EXPR) = isidentifier(x) && (valofid(x) == "__source__" || valofid(x) == "__module__") && is_in_fexpr(x, CSTParser.defines_macro)

0 commit comments

Comments
 (0)