假设我有一个返回闭包的函数:
--- 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中是否有标准方法来记录上述结构?
答案 0 :(得分:1)
您可以通过指定文档名称并手动输入来执行此操作:
--- This is a SugarAgent
-- @name SugarAgent
-- @class function
-- @return Some value
SugarAgent = Agent{ metabolism=5, health=3 }