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
|
end
|
||||||
if item_follows or comment_contains_tags(comment,args) then
|
if item_follows or comment_contains_tags(comment,args) then
|
||||||
tags = extract_tags(comment,args)
|
tags = extract_tags(comment,args)
|
||||||
|
|
||||||
-- explicitly named @module (which is recommended)
|
-- explicitly named @module (which is recommended)
|
||||||
if doc.project_level(tags.class) then
|
if doc.project_level(tags.class) then
|
||||||
module_found = tags.name
|
module_found = tags.name
|
||||||
-- might be a module returning a single function!
|
-- might be a module returning a single function!
|
||||||
if tags.param or tags['return'] then
|
if tags.param or tags['return'] then
|
||||||
local parms, ret, summ = tags.param, tags['return'],tags.summary
|
local parms, ret, summ = tags.param, tags['return'],tags.summary
|
||||||
|
local name = tags.name
|
||||||
tags.param = nil
|
tags.param = nil
|
||||||
tags['return'] = nil
|
tags['return'] = nil
|
||||||
tags.summary = nil
|
tags['class'] = nil
|
||||||
add_module(tags,tags.name,false)
|
tags['name'] = nil
|
||||||
|
add_module(tags,name,false)
|
||||||
tags = {
|
tags = {
|
||||||
summary = summ,
|
summary = '',
|
||||||
name = 'returns...',
|
name = 'returns...',
|
||||||
class = 'function',
|
class = 'function',
|
||||||
['return'] = ret,
|
['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