lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Jun 13, 2011 at 12:25 PM, Lorenzo Donati
<lorenzodonatibz@interfree.it> wrote:
> It seems that ldoc cannot automatically infer the following styles of
> function declarations inside a (new-style) module:
>
> -- style 1
> local function M_MyFunc(x)
>  ...
> end
> M.MyFunc = M_MyFunc

Very true - I made the decision not to consider local functions to be
'documentable', although this is probably too restrictive. The problem
here is that finding out the actual function name requires looking
ahead to the assignment to the M table. It can be done (nothing is
impossible) but will require some re-thinking: tagging a local
function and detecting when it is assigned to the module table (or
alias). Here the very free-form nature of Lua leads us to heuristics
and guess-work, and inevitably it will guess wrong sometimes ;)

> I worked around the problem using the @function tag, but in this case it
> seems that the parser has some problems with long comments preceding the doc
> comments.

Yes, that's definitely an issue - the long comment you use should not
be considered part of the 'doc comment'.

Thanks for giving the new girl a spin - a more formal release will
happen soon...

steve d.