假设我有一个返回闭包的函数:
--- Agent constructor
-- @return A function describing the behavior of the agent
Agent = function(data)
return function(arg1, arg2, ...) end
end然后我有一个变量来接收这个闭包:
SugarAgent = Agent{ metabolism=5, health=3 }在LuaDoc中是否有一种标准的方法来记录上述结构?
发布于 2014-03-08 19:09:29
您可以通过手动指定文档名和类型来做到这一点:
--- 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
https://stackoverflow.com/questions/22258352
复制相似问题