summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-10-08 20:51:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-10-08 20:51:12 +0800
commit33023775cd2b4dbc988e0ff30c1f661c55f67fb5 (patch)
tree15843082d1d69c931483e7322a908f1f8ade5099 /script/parser
parentd7f4f18d735b9b6fed7b6d15a9bfc7d41e995009 (diff)
downloadlua-language-server-33023775cd2b4dbc988e0ff30c1f661c55f67fb5.zip
fix #712
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/newparser.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index c110ca2d..001650fd 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -1858,19 +1858,18 @@ local function parseVarargs()
varargs.node = chunk.vararg
break
end
+ if chunk.type == 'main' then
+ break
+ end
if chunk.type == 'function' then
+ pushError {
+ type = 'UNEXPECT_DOTS',
+ start = varargs.start,
+ finish = varargs.finish,
+ }
break
end
end
- if not varargs.node
- and Mode == 'Lua'
- and Chunk[#Chunk].type ~= 'main' then
- pushError {
- type = 'UNEXPECT_DOTS',
- start = varargs.start,
- finish = varargs.finish,
- }
- end
return varargs
end