diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 19 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 4 |
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 |