Modules may return a single _function_ (see tests/funmod.lua)
This commit is contained in:
parent
ebdbf7d0e3
commit
ff60cbd7aa
|
@ -292,18 +292,21 @@ local function parse_file(fname, lang, package, args)
|
|||
end
|
||||
if item_follows or comment_contains_tags(comment,args) then
|
||||
tags = extract_tags(comment,args)
|
||||
|
||||
-- explicitly named @module (which is recommended)
|
||||
if doc.project_level(tags.class) then
|
||||
module_found = tags.name
|
||||
-- might be a module returning a single function!
|
||||
if tags.param or tags['return'] then
|
||||
local parms, ret, summ = tags.param, tags['return'],tags.summary
|
||||
local name = tags.name
|
||||
tags.param = nil
|
||||
tags['return'] = nil
|
||||
tags.summary = nil
|
||||
add_module(tags,tags.name,false)
|
||||
tags['class'] = nil
|
||||
tags['name'] = nil
|
||||
add_module(tags,name,false)
|
||||
tags = {
|
||||
summary = summ,
|
||||
summary = '',
|
||||
name = 'returns...',
|
||||
class = 'function',
|
||||
['return'] = ret,
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
-------
|
||||
-- Summing values.
|
||||
-- Returns a single function.
|
||||
-- @param a first
|
||||
-- @param b second
|
||||
-- @param c third
|
||||
-- @return sum of parameters
|
||||
-- @module funmod
|
||||
|
||||
return function(a,b,c)
|
||||
return a + b + c
|
||||
end
|
||||
|
Loading…
Reference in New Issue