diff options
Diffstat (limited to 'script-beta/parser')
-rw-r--r-- | script-beta/parser/guide.lua | 12 |
1 files changed, 4 insertions, 8 deletions
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 。 --- |