From 4af522a597345cd26e1d4a64bbfac3074f16235b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 30 Sep 2019 16:28:26 +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 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'server-beta/src/parser/guide.lua') diff --git a/server-beta/src/parser/guide.lua b/server-beta/src/parser/guide.lua index 3fb34d51..49b43f92 100644 --- a/server-beta/src/parser/guide.lua +++ b/server-beta/src/parser/guide.lua @@ -349,4 +349,13 @@ function m.lineRange(lines, row) return line.start + 1, line.finish end +function m.getKeyName(obj) + if obj.type == 'getglobal' or obj.type == 'setglobal' then + return obj[1] + elseif obj.type == 'getfield' or obj.type == 'setfield' then + return obj.field[1] + end + return nil +end + return m -- cgit v1.2.3