3

Suppose I have a function that returns a closure:

--- Agent constructor
-- @return A function describing the behavior of the agent
Agent = function(data)
   return function(arg1, arg2, ...) end
end

And then I have a variable that receives that closure:

SugarAgent = Agent{ metabolism=5, health=3 }

Is there a standard way in LuaDoc to document the above construction?

4

1 に答える 1

1

ドキュメント名とタイプを手動で指定することで実行できます。

--- This is a SugarAgent
-- @name SugarAgent
-- @class function
-- @return Some value
SugarAgent = Agent{ metabolism=5, health=3 }

http://keplerproject.github.io/luadoc/manual.html#tagsを参照してください

于 2014-03-08T19:09:29.130 に答える