From e1c72093b28cd08bc4a1b4a26dffd395651ca072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 16 Sep 2021 21:44:24 +0800 Subject: fix --- script/core/noder.lua | 2 ++ script/parser/luadoc.lua | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/core/noder.lua b/script/core/noder.lua index 749dcba6..3aad105e 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -1245,6 +1245,7 @@ compileNodeMap = util.switch() if not param1 then param1 = { type = 'select', + dummy = true, sindex = 2, start = node.start, finish = node.finish, @@ -1254,6 +1255,7 @@ compileNodeMap = util.switch() if not param2 then param2 = { type = 'select', + dummy = true, sindex = 2, start = node.start, finish = node.finish, diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 314e8e51..040bf4bb 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -552,7 +552,6 @@ function parseType(parent) enums = {}, resumes = {}, } - result.start = getStart() while true do local tp, content = peekToken() if not tp then @@ -630,6 +629,9 @@ function parseType(parent) end nextToken() end + if not result.start then + result.start = getFinish() + 1 + end result.finish = getFinish() + 1 result.firstFinish = result.finish @@ -697,7 +699,7 @@ function parseType(parent) if #result.types == 0 and #result.enums == 0 and #result.resumes == 0 then pushError { type = 'LUADOC_MISS_TYPE_NAME', - start = getFinish(), + start = getFinish() + 1, finish = getFinish() + 1, } return nil -- cgit v1.2.3