summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/luadoc.lua8
1 files changed, 8 insertions, 0 deletions
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