[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua style guide ?
- From: Sean Conner <sean@...>
- Date: Sun, 11 Jun 2017 19:15:03 -0400
It was thus said that the Great Russell Haley once stated:
> I'd like to find a way to generate the ldoc function headers from the file
> automagically so I could fill in the details afterwards.
I think it might be relatively easy (I'm saying this without even
bothering to try it) by using something like Luis' ltokenp (but perhaps
something else that preserves comments) to parse Lua code to at least
populate @function, @param, @local, and maybe even @raise (if it sees
error()).
For example, this function:
function encode(value,sref,stref)
local res = ""
if stref and not stref.SEEN then
res = TAG._stringref(nil,nil,stref)
end
return res .. __ENCODE_MAP[type(value)](value,sref,stref)
end
such a tool could return:
--- Placeholder
-- @function encode
-- @param value
-- @param sref
-- @param stref
-- @return
function encode(value,sref,stref)
...
-spc (I don't understand the full scope of this, so of course it must be
trivial! 8-P
- References:
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Edu Araújo
- Re: Lua style guide ?, Sean Conner
- Re: Lua style guide ?, steve donovan
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Martin
- Re: Lua style guide ?, steve donovan
- Re: Lua style guide ?, Russell Haley