summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 9ea674f4..47248ba4 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -257,6 +257,7 @@ local function parseTypeUnitArray(node)
finish = getFinish(),
node = node,
}
+ node.parent = result
return result
end
@@ -920,6 +921,7 @@ local function buildLuaDoc(comment)
type = 'doc.comment',
start = comment.start,
finish = comment.finish,
+ range = comment.finish,
comment = comment,
}
end
@@ -929,6 +931,7 @@ local function buildLuaDoc(comment)
parseTokens(doc, comment.start + startPos - 1)
local result = convertTokens()
if result then
+ result.range = comment.finish
local cstart = text:find('%S', result.finish - comment.start + 2)
if cstart and cstart < comment.finish then
result.comment = {
@@ -940,7 +943,17 @@ local function buildLuaDoc(comment)
end
end
- return result
+ if result then
+ return result
+ end
+
+ return {
+ type = 'doc.comment',
+ start = comment.start,
+ finish = comment.finish,
+ range = comment.finish,
+ comment = comment,
+ }
end
---当前行在注释doc前是否有代码