From 76c7098956305de4ca0be6f260c10ab8f8c6fa04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 26 Apr 2023 14:11:14 +0800 Subject: lock parsing resume fix #2056 --- script/parser/luadoc.lua | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'script/parser/luadoc.lua') diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 2f5a8ad3..c022adcb 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -700,6 +700,8 @@ local function parseResume(parent) return result end +local lockResume = false + function parseType(parent) local result = { type = 'doc.type', @@ -778,20 +780,10 @@ function parseType(parent) return false end - local checkResume = true - local nsymbol, ncontent = peekToken() - if nsymbol == 'symbol' then - if ncontent == ',' - or ncontent == ':' - or ncontent == '|' - or ncontent == ')' - or ncontent == '}' then - checkResume = false - end - end - - if checkResume then + if not lockResume then + lockResume = true while pushResume() do end + lockResume = false end if #result.types == 0 then @@ -2051,6 +2043,7 @@ return function (state) if not comment then break end + lockResume = false local doc, rests = buildLuaDoc(comment) if doc then insertDoc(doc, comment) -- cgit v1.2.3