diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-03 18:54:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-03 18:54:33 +0800 |
commit | bd9aacf509cf65584d56f6673f63b48974fbe018 (patch) | |
tree | d47c72a69a4f6de691924f082a8ca7b923a8d3d8 /script-beta/vm | |
parent | 0ee236351febdd81e4bc95ed74bc667e21d3763d (diff) | |
download | lua-language-server-bd9aacf509cf65584d56f6673f63b48974fbe018.zip |
修改library的结构,方便解析
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/guideInterface.lua | 8 | ||||
-rw-r--r-- | script-beta/vm/vm.lua | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/script-beta/vm/guideInterface.lua b/script-beta/vm/guideInterface.lua index 26d4bd4c..2bca395b 100644 --- a/script-beta/vm/guideInterface.lua +++ b/script-beta/vm/guideInterface.lua @@ -91,17 +91,17 @@ function vm.interface.link(uri) end function vm.interface.index(obj) - if obj.library then + if obj.type == 'library' then return obj.fields end local tp = obj.type if tp == 'getglobal' and obj.node.special == '_G' then - obj = library.global[obj[1]] - if not obj then + local lib = library.global[obj[1]] + if not lib then return nil end - tp = obj.type + tp = lib.value.type end local lib = library.object[tp] if lib then diff --git a/script-beta/vm/vm.lua b/script-beta/vm/vm.lua index 907532d8..53a0596d 100644 --- a/script-beta/vm/vm.lua +++ b/script-beta/vm/vm.lua @@ -100,7 +100,7 @@ function m.getKeyName(source) if not source then return nil end - if source.library then + if source.type == 'library' then return 's|' .. source.name end if source.type == 'call' then |