From 1d3b6b97b89b34fee5178b7e09b21d1738986cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sun, 27 Sep 2020 01:40:11 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/guide.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'script-beta/parser') diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index f066d925..da2dc6e5 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -219,8 +219,11 @@ function m.getUri(obj) end function m.getENV(source, start) + if not start then + start = 1 + end return m.getLocal(source, '_ENV', start) - or m.getLabel(source, '@env', start) + or m.getLocal(source, '@env', start) end --- 寻找函数的不定参数,返回不定参在第几个参数上,以及该参数对象。 @@ -632,13 +635,6 @@ function m.getSimpleName(obj) return m.getKeyName(obj) end -function m.getENV(ast) - if ast.type ~= 'main' then - return nil - end - return ast.locals and ast.locals[1] -end - --- 测试 a 到 b 的路径(不经过函数,不考虑 goto), --- 每个路径是一个 block 。 --- -- cgit v1.2.3