From 12e07305cf74f7e98adbfb482b01aceb0c72fd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 25 Sep 2019 11:48:50 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/parser/guide.lua | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'server-beta/src/parser') 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'} -- cgit v1.2.3