Codebase list lua-ldoc / 27fcd4d
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
3 changed file(s) with 34 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
285285 for m,v in pairs(amod) do
286286 local idx = v:match('^%$(%d+)')
287287 if idx then
288 v, value = value:match('(%S+)%s+(.+)')
288 v, value = value:match('(%S+)(.*)')
289289 end
290290 modifiers[m] = v
291291 end
612612 --------- dumping out modules and items -------------
613613
614614 function Module:dump(verbose)
615 if self.type ~= 'module' then return end
615616 print '----'
616617 print(self.type..':',self.name,self.summary)
617618 if self.description then print(self.description) end
639640 print()
640641 print(self.type,name)
641642 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
648664 end
649665 else
650666 print('* '..name..' - '..self.summary)
429429 end
430430
431431 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
433435 project:add(mod,module_list)
434436 end
435437
99 -- A reference to `mydata`.
1010 -- @string name
1111 -- @int age
12 -- @treturn mydata result
12 -- @treturn mydata
1313 function _M.first (name,age)
1414
1515 end
16
17 --- simple function returning something
18 -- @return bonzo dog!
19 function _M.simple()
20
21 end
22
1623
1724 --- a table of this module.
1825 -- @table mydata