summaryrefslogtreecommitdiff
path: root/server/src/matcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-30 10:40:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-30 10:40:38 +0800
commit2b24d57a2f7b0437a1d92e81ada51171c8f8fe3d (patch)
tree9cf8fc29896d227969639097ce895e5ed4fed7a7 /server/src/matcher
parentabd2a22ef2fc4197aab1cdf0ccae386b55db3dcc (diff)
downloadlua-language-server-2b24d57a2f7b0437a1d92e81ada51171c8f8fe3d.zip
表里的值
Diffstat (limited to 'server/src/matcher')
-rw-r--r--server/src/matcher/definition.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/matcher/definition.lua b/server/src/matcher/definition.lua
index 255e6405..ee18e6ff 100644
--- a/server/src/matcher/definition.lua
+++ b/server/src/matcher/definition.lua
@@ -63,6 +63,16 @@ function mt:searchUnary(exp)
return self:searchExp(exp[1])
end
+function mt:searchTable(exp)
+ for _, obj in ipairs(exp) do
+ if obj.type == 'pair' then
+ self:searchExp(obj[2])
+ else
+ self:searchExp(obj)
+ end
+ end
+end
+
function mt:searchExp(exp)
local tp = exp.type
if tp == 'nil' then
@@ -82,6 +92,7 @@ function mt:searchExp(exp)
elseif tp == 'function' then
self:searchFunction(exp)
elseif tp == 'table' then
+ self:searchTable(exp)
end
end