diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-07-22 20:28:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-07-22 20:28:41 +0800 |
commit | d60ad2c5826162c480dba8f1bc810758bb090327 (patch) | |
tree | 33d8e46e939a2d9ae0a4f0e71a4946450dd821e8 | |
parent | c87edd45eaeb810d251f082995477e52ae8b28b2 (diff) | |
download | lua-language-server-d60ad2c5826162c480dba8f1bc810758bb090327.zip |
删除一些无用的代码
-rw-r--r-- | script-beta/vm/getCall.lua | 5 | ||||
-rw-r--r-- | script-beta/vm/getLinks.lua | 48 | ||||
-rw-r--r-- | script-beta/vm/init.lua | 2 | ||||
-rw-r--r-- | script-beta/vm/special.lua | 0 | ||||
-rw-r--r-- | script-beta/vm/vm.lua | 10 |
5 files changed, 0 insertions, 65 deletions
diff --git a/script-beta/vm/getCall.lua b/script-beta/vm/getCall.lua deleted file mode 100644 index f769633e..00000000 --- a/script-beta/vm/getCall.lua +++ /dev/null @@ -1,5 +0,0 @@ -local vm = require 'vm.vm' - -function vm.getCallRecv(source) - -end diff --git a/script-beta/vm/getLinks.lua b/script-beta/vm/getLinks.lua deleted file mode 100644 index 6875771f..00000000 --- a/script-beta/vm/getLinks.lua +++ /dev/null @@ -1,48 +0,0 @@ -local guide = require 'parser.guide' -local vm = require 'vm.vm' - -local function getLinks(root) - local cache = {} - local ok - guide.eachSpecialOf(root, 'require', function (source) - local call = source.parent - if call.type == 'call' then - local uris = vm.getLinkUris(call) - if uris then - ok = true - for i = 1, #uris do - local uri = uris[i] - if not cache[uri] then - cache[uri] = {} - end - cache[uri][#cache[uri]+1] = call - end - end - end - end) - if not ok then - return nil - end - return cache -end - -function vm.getLinks(source) - source = guide.getRoot(source) - local cache = vm.cache.getLinks[source] - if cache ~= nil then - return cache - end - local unlock = vm.lock('getLinks', source) - if not unlock then - return nil - end - local clock = os.clock() - cache = getLinks(source) or false - local passed = os.clock() - clock - if passed > 0.1 then - log.warn(('getLinks takes [%.3f] sec!'):format(passed)) - end - vm.cache.getLinks[source] = cache - unlock() - return cache -end diff --git a/script-beta/vm/init.lua b/script-beta/vm/init.lua index 00aaff2e..cd01e35c 100644 --- a/script-beta/vm/init.lua +++ b/script-beta/vm/init.lua @@ -1,6 +1,5 @@ local vm = require 'vm.vm' require 'vm.getGlobals' -require 'vm.getLinks' require 'vm.getGlobal' require 'vm.getLibrary' require 'vm.getValue' @@ -9,6 +8,5 @@ require 'vm.getMeta' require 'vm.eachField' require 'vm.eachDef' require 'vm.eachRef' -require 'vm.getCall' require 'vm.guideInterface' return vm diff --git a/script-beta/vm/special.lua b/script-beta/vm/special.lua deleted file mode 100644 index e69de29b..00000000 --- a/script-beta/vm/special.lua +++ /dev/null diff --git a/script-beta/vm/vm.lua b/script-beta/vm/vm.lua index 26f1f190..c55b46bd 100644 --- a/script-beta/vm/vm.lua +++ b/script-beta/vm/vm.lua @@ -10,16 +10,6 @@ local ipairs = ipairs _ENV = nil -local specials = { - ['_G'] = true, - ['rawset'] = true, - ['rawget'] = true, - ['setmetatable'] = true, - ['require'] = true, - ['dofile'] = true, - ['loadfile'] = true, -} - ---@class vm local m = {} |