diff options
-rw-r--r-- | script-beta/core/diagnostics/undefined-doc-name.lua | 3 | ||||
-rw-r--r-- | script-beta/parser/luadoc.lua | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/script-beta/core/diagnostics/undefined-doc-name.lua b/script-beta/core/diagnostics/undefined-doc-name.lua index 07894a54..5c1e8fbf 100644 --- a/script-beta/core/diagnostics/undefined-doc-name.lua +++ b/script-beta/core/diagnostics/undefined-doc-name.lua @@ -44,6 +44,9 @@ return function (uri, callback) return end local name = source[1] + if name == '...' then + return + end if hasNameOfClassOrAlias(name) or hasNameOfGeneric(name, source) then return diff --git a/script-beta/parser/luadoc.lua b/script-beta/parser/luadoc.lua index d71a7b50..94ddd37e 100644 --- a/script-beta/parser/luadoc.lua +++ b/script-beta/parser/luadoc.lua @@ -53,6 +53,7 @@ Symbol <- ({} { / '(' / ')' / '?' + / '...' } {}) -> Symbol ]], { @@ -430,6 +431,19 @@ function parseType(parent) if not result.start then result.start = typeEnum.start end + elseif tp == 'symbol' and content == '...' then + nextToken() + local vararg = { + type = 'doc.type.name', + start = getStart(), + finish = getFinish(), + parent = result, + [1] = content, + } + result.types[#result.types+1] = vararg + if not result.start then + result.start = vararg.start + end end if not checkToken('symbol', '|', 1) then break @@ -678,6 +692,14 @@ local function parseOverload() return result end +local function parseDeprecated() + return { + type = 'doc.deprecated', + start = getFinish(), + finish = getFinish(), + } +end + local function convertTokens() local tp, text = nextToken() if not tp then @@ -709,6 +731,8 @@ local function convertTokens() return parseVararg() elseif text == 'overload' then return parseOverload() + elseif text == 'deprecated' then + return parseDeprecated() end end |