summaryrefslogtreecommitdiff
path: root/script-beta/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-27 01:40:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-27 01:40:11 +0800
commit1d3b6b97b89b34fee5178b7e09b21d1738986cf3 (patch)
tree983e367317181d0df74db092043e4a9767801380 /script-beta/parser/guide.lua
parentd4f79cf74dffc4930b19029fc39090d27b048b44 (diff)
downloadlua-language-server-1d3b6b97b89b34fee5178b7e09b21d1738986cf3.zip
修正一些bug
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r--script-beta/parser/guide.lua12
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 。
---