diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-10 11:03:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-10 11:03:12 +0800 |
commit | be6e0ee6d31d79005691b982c02e7699a7ae3762 (patch) | |
tree | 15bca6f55c6acd92bcfcb772a9008efe0d6dc594 /server/src/matcher/compile.lua | |
parent | d19514f1904557a464467bfc9540882b4a214840 (diff) | |
download | lua-language-server-be6e0ee6d31d79005691b982c02e7699a7ae3762.zip |
布尔和数字
Diffstat (limited to 'server/src/matcher/compile.lua')
-rw-r--r-- | server/src/matcher/compile.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/src/matcher/compile.lua b/server/src/matcher/compile.lua index bcf2ca91..c6ccedfe 100644 --- a/server/src/matcher/compile.lua +++ b/server/src/matcher/compile.lua @@ -278,13 +278,31 @@ function mt:getString(exp) } end +function mt:getBoolean(exp) + return { + type = 'boolean', + boolean = exp[1], + valuetype = 'boolean', + } +end + +function mt:getNumber(exp) + return { + type = 'number', + number = exp[1], + valuetype = 'number', + } +end + function mt:searchExp(exp) local tp = exp.type if tp == 'nil' then elseif tp == 'string' then return self:getString(exp) elseif tp == 'boolean' then + return self:getBoolean(exp) elseif tp == 'number' then + return self:getNumber(exp) elseif tp == 'name' then return self:checkName(exp) elseif tp == 'simple' then |