Do not resolve references when using -m. Can now use @treturn just with a type (pattern fix). Default dump more structured.
steve donovan
12 years ago
285 | 285 |
for m,v in pairs(amod) do
|
286 | 286 |
local idx = v:match('^%$(%d+)')
|
287 | 287 |
if idx then
|
288 | |
v, value = value:match('(%S+)%s+(.+)')
|
|
288 |
v, value = value:match('(%S+)(.*)')
|
289 | 289 |
end
|
290 | 290 |
modifiers[m] = v
|
291 | 291 |
end
|
|
612 | 612 |
--------- dumping out modules and items -------------
|
613 | 613 |
|
614 | 614 |
function Module:dump(verbose)
|
|
615 |
if self.type ~= 'module' then return end
|
615 | 616 |
print '----'
|
616 | 617 |
print(self.type..':',self.name,self.summary)
|
617 | 618 |
if self.description then print(self.description) end
|
|
639 | 640 |
print()
|
640 | 641 |
print(self.type,name)
|
641 | 642 |
print(self.summary)
|
642 | |
if self.description then print(self.description) end
|
643 | |
for _,p in ipairs(self.params) do
|
644 | |
print(p,self.params[p])
|
645 | |
end
|
646 | |
for tag, value in pairs(self.tags) do
|
647 | |
print(tag,value)
|
|
643 |
if self.description and self.description:match '%S' then
|
|
644 |
print 'description:'
|
|
645 |
print(self.description)
|
|
646 |
end
|
|
647 |
if #self.params > 0 then
|
|
648 |
print 'parameters:'
|
|
649 |
for _,p in ipairs(self.params) do
|
|
650 |
print('',p,self.params[p])
|
|
651 |
end
|
|
652 |
end
|
|
653 |
if self.ret and #self.ret > 0 then
|
|
654 |
print 'returns:'
|
|
655 |
for _,r in ipairs(self.ret) do
|
|
656 |
print('',r)
|
|
657 |
end
|
|
658 |
end
|
|
659 |
if next(self.tags) then
|
|
660 |
print 'tags:'
|
|
661 |
for tag, value in pairs(self.tags) do
|
|
662 |
print(tag,value)
|
|
663 |
end
|
648 | 664 |
end
|
649 | 665 |
else
|
650 | 666 |
print('* '..name..' - '..self.summary)
|
429 | 429 |
end
|
430 | 430 |
|
431 | 431 |
for mod in module_list:iter() do
|
432 | |
mod:resolve_references(module_list)
|
|
432 |
if not args.module then -- no point if we're just showing docs on the console
|
|
433 |
mod:resolve_references(module_list)
|
|
434 |
end
|
433 | 435 |
project:add(mod,module_list)
|
434 | 436 |
end
|
435 | 437 |
|
9 | 9 |
-- A reference to `mydata`.
|
10 | 10 |
-- @string name
|
11 | 11 |
-- @int age
|
12 | |
-- @treturn mydata result
|
|
12 |
-- @treturn mydata
|
13 | 13 |
function _M.first (name,age)
|
14 | 14 |
|
15 | 15 |
end
|
|
16 |
|
|
17 |
--- simple function returning something
|
|
18 |
-- @return bonzo dog!
|
|
19 |
function _M.simple()
|
|
20 |
|
|
21 |
end
|
|
22 |
|
16 | 23 |
|
17 | 24 |
--- a table of this module.
|
18 | 25 |
-- @table mydata
|