mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Change LDoc to properly format optional arguments and defaults
This commit is contained in:
parent
218299193f
commit
0128660f07
3 changed files with 13 additions and 14 deletions
|
@ -868,20 +868,19 @@ function build_arg_list (names,pmods)
|
|||
local opt
|
||||
if m then
|
||||
if not m.optchain then
|
||||
acc ((']'):rep(npending))
|
||||
npending=0
|
||||
end
|
||||
opt = m.optchain or m.opt
|
||||
if opt then
|
||||
acc('[')
|
||||
npending=npending+1
|
||||
end
|
||||
end
|
||||
if i>1 then acc (', ') end
|
||||
acc(names[i])
|
||||
if opt and opt ~= true then acc('='..opt) end
|
||||
if opt then
|
||||
acc('[' .. names[i])
|
||||
if opt ~= true then acc('='..opt) end
|
||||
acc(']')
|
||||
else
|
||||
acc(names[i])
|
||||
end
|
||||
end
|
||||
acc ((']'):rep(npending))
|
||||
return '('..table.concat(buffer)..')'
|
||||
end
|
||||
|
||||
|
|
|
@ -215,12 +215,12 @@ return [==[
|
|||
# end
|
||||
$(M(item.params.map[p],item))
|
||||
# if def == true then
|
||||
(<em>optional</em>)
|
||||
(<em>Optional.</em>)
|
||||
# elseif def then
|
||||
(<em>default</em> $(def))
|
||||
(<em>Default.</em> $(def))
|
||||
# end
|
||||
# if item:readonly(p) then
|
||||
<em>readonly</em>
|
||||
<em>Read-only.</em>
|
||||
# end
|
||||
</li>
|
||||
# end
|
||||
|
|
|
@ -216,12 +216,12 @@
|
|||
# end
|
||||
$(M(item.params.map[p],item))
|
||||
# if def == true then
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
# elseif def then
|
||||
(<em>default</em> $(def))
|
||||
<em>Default: $(def).</em>
|
||||
# end
|
||||
# if item:readonly(p) then
|
||||
<em>readonly</em>
|
||||
<em>Read-only.</em>
|
||||
# end
|
||||
</li>
|
||||
# end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue