mirror of
https://github.com/CorsixTH/CorsixTH.git
synced 2025-07-23 12:23:05 +02:00
Add support for documenting vararg parameters to LDocGen.
This commit is contained in:
@@ -147,6 +147,11 @@ end
|
||||
|
||||
function LuaFunction:setIsVararg(is)
|
||||
self.is_vararg = is
|
||||
if is then
|
||||
self.vararg_parameter = LuaVariable():setName("...")
|
||||
else
|
||||
self.vararg_parameter = nil
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -177,6 +182,9 @@ function LuaFunction:getParameter(name)
|
||||
return param
|
||||
end
|
||||
end
|
||||
if name == "..." then
|
||||
return self.vararg_parameter
|
||||
end
|
||||
end
|
||||
|
||||
function LuaTable:LuaTable()
|
||||
|
@@ -58,6 +58,9 @@ local function ParseComments(tokens, i, object)
|
||||
if operation == "" then
|
||||
if operand ~= "" then
|
||||
if object:getShortDesc() then
|
||||
if object:getLongDesc() then
|
||||
object:setShortDesc(object:getLongDesc())
|
||||
end
|
||||
object:setLongDesc(operand)
|
||||
else
|
||||
object:setShortDesc(operand)
|
||||
@@ -66,7 +69,7 @@ local function ParseComments(tokens, i, object)
|
||||
elseif operation == "dummy" then
|
||||
object:setIsDummy(true)
|
||||
elseif operation == "param" then
|
||||
local pname, pdesc = operand:match"^%s*([a-zA-Z_][a-zA-Z0-9_]*)%s*(.*)$"
|
||||
local pname, pdesc = operand:match"^%s*([a-zA-Z_.]%.?%.?[a-zA-Z0-9_]*)%s*(.*)$"
|
||||
local param = object:getParameter(pname)
|
||||
if not param then
|
||||
error("Unknown parameter: ".. pname .." (".. tokens.__file
|
||||
|
Reference in New Issue
Block a user