[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: how to annotate lua source-code to specify behaviour ?
- From: Nagaev Boris <bnagaev@...>
- Date: Thu, 26 Mar 2015 23:31:11 +0000
On Thu, Mar 26, 2015 at 11:22 PM, Valerio Schiavoni
> is there some easy way to annotate Lua source, similarly to what happens
> with the @Annotate mechanism in Java?
> Ideally, such annotations should assigned to variables, tables and
> Annotations should be assigned to behaviours triggered by operations that
> are specific to each type of annotation.
> Something like this:
> --begin lua code
> The effect of the presence of the annotation should be reflected by the init
> of the table's meta-table to trigger some application-specific action.
> Without such annotation mechanism, I can only see the following
> alternatives, which would however require
> some more efforts:
> - somehow override the table creation mechanism so that the table's
> metatables are automatically modified upon creation
> - similarly for variables and functions
> Any suggestion is greatly appreciated.
LDoc - A Lua Documentation Tool  provides annotations for functions
--- Summary ends with a period.
-- Some description, can be over several lines.
-- @param p1 first parameter
-- @param p2 second parameter
-- @return a string value
-- @see second_fun