diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 09:45:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 09:45:31 +0800 |
commit | fa33c7926f9ba018869d39d247a7f2e184d86261 (patch) | |
tree | 6f4b31c94f80a698f562b27427caea225d68ccd5 /server/src/core | |
parent | 10c6e1cab7d727a94617ded2adbc5bf3e57824b2 (diff) | |
download | lua-language-server-fa33c7926f9ba018869d39d247a7f2e184d86261.zip |
删掉没用的代码
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/vm.lua | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua index 6d941747..156b73d4 100644 --- a/server/src/core/vm.lua +++ b/server/src/core/vm.lua @@ -9,77 +9,6 @@ local function getDefaultSource() return { start = 0, finish = 0 } end --- 根据赋值顺序决定遍历顺序的表 -local function orderTable() - local t = {} - local list = {} - local mark = {} - return setmetatable(t, { - __newindex = function (self, k, v) - if not mark[k] then - mark[k] = true - list[#list+1] = k - end - rawset(self, k, v) - end, - __pairs = function (self) - local i = 0 - return function () - while true do - i = i + 1 - local k = list[i] - if not k then - return nil, nil - end - local v = t[k] - if v ~= nil then - return k, v - end - end - end - end, - }) -end - -local function readOnly(t) - return setmetatable({}, { - __index = function (self, k) - if k == nil then - return nil - end - local v = t[k] - if type(v) == 'table' then - v = readOnly(v) - end - self[k] = v - return v - end, - __len = function (self) - return #t - end, - __pairs = function (self) - local keys = {} - local mark = {} - for k in next, self do - keys[#keys+1] = k - end - for k in pairs(t) do - if not mark[k] then - mark[k] = true - keys[#keys+1] = k - end - end - local i = 0 - return function () - i = i + 1 - local k = keys[i] - return k, self[k] - end - end, - __source = t, - }) -end - local mt = {} mt.__index = mt @@ -90,7 +19,7 @@ function mt:createDummyVar(source, value) local loc = { type = 'local', key = '', - source = source or DefaultSource, + source = source or getDefaultSource(), } if source then |