summaryrefslogtreecommitdiff
path: root/server/src/parser
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-06-04 11:14:46 +0800
committersumneko <sumneko@hotmail.com>2019-06-04 11:14:46 +0800
commit7013b50fa17c09fb9b56420ded6b9545c50e5772 (patch)
treec9a7b693d94cde4739ff10039ff0779781e2b171 /server/src/parser
parentac7624b3155ded997233db4c1362767e967eae6d (diff)
downloadlua-language-server-7013b50fa17c09fb9b56420ded6b9545c50e5772.zip
检查多余的tag
Diffstat (limited to 'server/src/parser')
-rw-r--r--server/src/parser/ast.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index 130f497c..ab3bcae0 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -841,7 +841,7 @@ local Defs = {
return nil
end
local tags = {...}
- for _, tag in ipairs(tags) do
+ for i, tag in ipairs(tags) do
if State.Version ~= 'Lua 5.4' then
pushError {
type = 'UNSUPPORT_SYMBOL',
@@ -861,6 +861,15 @@ local Defs = {
tag = tag[1],
}
}
+ elseif i > 1 then
+ pushError {
+ type = 'MULTI_TAG',
+ start = tag.start,
+ finish = tag.finish,
+ info = {
+ tag = tag[1],
+ }
+ }
end
end
return tags