summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-05-13 20:28:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-05-13 20:28:55 +0800
commit50832a63579ba96587a8bd9bcf408302cea808e0 (patch)
tree4442745ee92df6ec2dbc0bb01f61f8dbd90fe95e /script/parser
parent177f39f546fe9a78fb32eafab522712fd5e0d2f6 (diff)
downloadlua-language-server-50832a63579ba96587a8bd9bcf408302cea808e0.zip
fix
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua19
-rw-r--r--script/parser/luadoc.lua4
2 files changed, 3 insertions, 20 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index a838a42e..5f56be44 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -74,7 +74,7 @@ m.childMap = {
['doc.generic.object'] = {'generic', 'extends', 'comment'},
['doc.vararg'] = {'vararg', 'comment'},
['doc.type.array'] = {'node'},
- ['doc.type.table'] = {'node', 'key', 'value', 'comment'},
+ ['doc.type.table'] = {'node', 'tkey', 'tvalue', 'comment'},
['doc.type.function'] = {'#args', '#returns', 'comment'},
['doc.type.literal'] = {'node'},
['doc.type.arg'] = {'extends'},
@@ -142,23 +142,6 @@ function m.getParentFunction(obj)
return nil
end
---- 寻找父的table类型 doc.type.table
----@param obj parser.guide.object
----@return parser.guide.object
-function m.getParentDocTypeTable(obj)
- for _ = 1, 1000 do
- local parent = obj.parent
- if not parent then
- return nil
- end
- if parent.type == 'doc.type.table' then
- return obj
- end
- obj = parent
- end
- error('guide.getParentDocTypeTable overstack')
-end
-
--- 寻找所在区块
---@param obj parser.guide.object
---@return parser.guide.object
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 5f70a9e5..e2630446 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -300,8 +300,8 @@ local function parseTypeUnitTable(parent, node)
node.parent = result;
result.finish = getFinish()
- result.key = key
- result.value = value
+ result.tkey = key
+ result.tvalue = value
return result
end