From 09e873bf25f1dbaccd97d4fe7f608dde1fe68028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 31 Oct 2020 15:44:41 +0800 Subject: =?UTF-8?q?doc.param=20=E5=92=8C=20doc.return=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/luadoc.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'script-beta/parser') diff --git a/script-beta/parser/luadoc.lua b/script-beta/parser/luadoc.lua index ca4ee25d..933ce1be 100644 --- a/script-beta/parser/luadoc.lua +++ b/script-beta/parser/luadoc.lua @@ -453,6 +453,10 @@ local function parseParam() end result.start = getStart() result.extends = parseType(result) + if checkToken('symbol', '?', 1) then + nextToken() + result.optional = true + end if not result.extends then pushError { type = 'LUADOC_MISS_PARAM_EXTENDS', @@ -478,6 +482,10 @@ local function parseReturn() if not result.start then result.start = docType.start end + if checkToken('symbol', '?', 1) then + nextToken() + docType.optional = true + end result.returns[#result.returns+1] = docType if not checkToken('symbol', ',', 1) then break -- cgit v1.2.3