issue #78 default parm value now in documentation
Steve Donovan
10 years ago
751 | 751 |
return '('..table.concat(buffer)..')'
|
752 | 752 |
end
|
753 | 753 |
|
754 | |
function Item:type_of_param(p)
|
|
754 |
function Item:param_modifiers (p)
|
755 | 755 |
local mods = self.modifiers[self.parameter]
|
756 | 756 |
if not mods then return '' end
|
757 | |
local mparam = rawget(mods,p)
|
|
757 |
return rawget(mods,p)
|
|
758 |
end
|
|
759 |
|
|
760 |
function Item:type_of_param(p)
|
|
761 |
local mparam = self:param_modifiers(p)
|
758 | 762 |
return mparam and mparam.type or ''
|
|
763 |
end
|
|
764 |
|
|
765 |
function Item:default_of_param(p)
|
|
766 |
local m = self:param_modifiers(p)
|
|
767 |
if not m then return nil end
|
|
768 |
local opt = m.optchain or m.opt
|
|
769 |
if opt == true then return nil end
|
|
770 |
return opt
|
759 | 771 |
end
|
760 | 772 |
|
761 | 773 |
function Item:type_of_ret(idx)
|
164 | 164 |
<ul>
|
165 | 165 |
# end
|
166 | 166 |
# for p in iter(param) do
|
167 | |
# local name,tp = item:display_name_of(p), ldoc.typename(item:type_of_param(p))
|
|
167 |
# local name,tp,def = item:display_name_of(p), ldoc.typename(item:type_of_param(p)), item:default_of_param(p)
|
168 | 168 |
<li><span class="parameter">$(name)</span>
|
169 | 169 |
# if tp ~= '' then
|
170 | 170 |
<span class="types">$(tp)</span>
|
171 | |
# end
|
172 | |
$(M(item.params[p],item))</li>
|
|
171 |
# end
|
|
172 |
$(M(item.params[p],item))
|
|
173 |
# if def then
|
|
174 |
(<em>default</em> $(def))
|
|
175 |
# end
|
|
176 |
</li>
|
173 | 177 |
# end
|
174 | 178 |
# if sublist then
|
175 | 179 |
</li></ul>
|