summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/matcher/find_lib.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/src/matcher/find_lib.lua b/server/src/matcher/find_lib.lua
index 3d98aef7..f24dabd4 100644
--- a/server/src/matcher/find_lib.lua
+++ b/server/src/matcher/find_lib.lua
@@ -179,9 +179,6 @@ local function checkParentAsObject(parentValue, name, parent)
end
local function checkParent(value, name, lib)
- if not lib.parent then
- return nil
- end
if name ~= value.key then
return nil
end
@@ -214,13 +211,16 @@ end
local function findLib(var, libs)
local value = var.value or var
for libname, lib in pairs(libs) do
- local fullKey = checkSource(value, libname, lib)
- if fullKey then
- return lib, fullKey, false
- end
- local fullKey, oo = checkParent(value, libname, lib)
- if fullKey then
- return lib, fullKey, oo
+ if lib.parent then
+ local fullKey, oo = checkParent(value, libname, lib)
+ if fullKey then
+ return lib, fullKey, oo
+ end
+ else
+ local fullKey = checkSource(value, libname, lib)
+ if fullKey then
+ return lib, fullKey, false
+ end
end
end
return nil, nil, nil