summaryrefslogtreecommitdiff
path: root/server-beta/src/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-25 11:48:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-25 11:48:50 +0800
commit12e07305cf74f7e98adbfb482b01aceb0c72fd61 (patch)
treee8b619baee09a550cd5070253b09ea25182538a2 /server-beta/src/parser
parentf501deff48a30e937afdcb528aba942648c4888b (diff)
downloadlua-language-server-12e07305cf74f7e98adbfb482b01aceb0c72fd61.zip
整理代码
Diffstat (limited to 'server-beta/src/parser')
-rw-r--r--server-beta/src/parser/guide.lua24
1 files changed, 0 insertions, 24 deletions
diff --git a/server-beta/src/parser/guide.lua b/server-beta/src/parser/guide.lua
index e6be631d..bd7f9150 100644
--- a/server-beta/src/parser/guide.lua
+++ b/server-beta/src/parser/guide.lua
@@ -215,30 +215,6 @@ function m.eachSourceOf(root, types, callback)
end
end
---- 遍历全局变量
-function m.eachGloabl(root, callback)
- m.eachSourceOf(root, {'setglobal', 'getglobal', 'setfield', 'getfield'}, function (src)
- if src.type == 'setglobal' or src.type == 'getglobal' then
- callback(src, src[1])
- elseif src.type == 'setfield' or src.type == 'getfield' then
- local node = root[src.node]
- if m.isGlobal(root, node) then
- callback(src, src.field[1])
- end
- end
- end)
-end
-
---- 判断全局变量
-function m.isGlobal(root, obj)
- if obj.type == 'getglobal' then
- if obj[1] == '_G' or obj[1] == '_ENV' then
- return true
- end
- end
- return false
-end
-
--- 获取偏移对应的坐标(row从0开始,col为光标位置)
---@param lines table
---@return integer {name = 'row'}