summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-09 20:16:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-09 20:16:39 +0800
commit3932717d816bfc4f98cd9640daca51fb6f2afe8c (patch)
tree934e153b2a5b1427de71e4dc87074bc6b7ae9b71 /script/parser
parent2a439122a6d6d841fb99f08a1276c4400e5360fa (diff)
downloadlua-language-server-3932717d816bfc4f98cd9640daca51fb6f2afe8c.zip
cleanup
merge `doc.type.enums` and `doc.type.resumes` into `doc.type.types`
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua4
-rw-r--r--script/parser/luadoc.lua8
2 files changed, 4 insertions, 8 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index e306f1e1..6f09d119 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -27,8 +27,6 @@ local type = type
---@field index parser.guide.object
---@field extends parser.guide.object[]
---@field types parser.guide.object[]
----@field enums parser.guide.object[]
----@field resumes parser.guide.object[]
---@field fields parser.guide.object[]
---@field typeGeneric table<integer, parser.guide.object[]>
---@field tkey parser.guide.object
@@ -128,7 +126,7 @@ local childMap = {
['doc'] = {'#'},
['doc.class'] = {'class', '#extends', 'comment'},
- ['doc.type'] = {'#types', '#enums', '#resumes', 'name', 'comment'},
+ ['doc.type'] = {'#types', 'name', 'comment'},
['doc.alias'] = {'alias', 'extends', 'comment'},
['doc.param'] = {'param', 'extends', 'comment'},
['doc.return'] = {'#returns', 'comment'},
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 576cdb5c..a47ebe34 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -570,8 +570,6 @@ function parseType(parent)
type = 'doc.type',
parent = parent,
types = {},
- enums = {},
- resumes = {},
}
while true do
local tp, content = peekToken()
@@ -617,7 +615,7 @@ function parseType(parent)
parent = result,
[1] = content,
}
- result.enums[#result.enums+1] = typeEnum
+ result.types[#result.types+1] = typeEnum
if not result.start then
result.start = typeEnum.start
end
@@ -685,7 +683,7 @@ function parseType(parent)
else
resume.comment = nextComm.text:match('#%s*(.+)', 3)
end
- result.resumes[#result.resumes+1] = resume
+ result.types[#result.types+1] = resume
result.finish = resume.finish
end
comments = nil
@@ -717,7 +715,7 @@ function parseType(parent)
while pushResume() do end
end
- if #result.types == 0 and #result.enums == 0 and #result.resumes == 0 then
+ if #result.types == 0 then
pushWarning {
type = 'LUADOC_MISS_TYPE_NAME',
start = getFinish(),