summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-04-22 13:54:33 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-12 11:59:09 +0100
commit8ce185d8a6c03cfd4b43bd979d7e00fa55435a12 (patch)
treee5561ac03bc83896f464b38fa40e1f7aaee32d4a
parent4bbc956079cf5371136774de175f8e13063c7872 (diff)
downloadefl-8ce185d8a6c03cfd4b43bd979d7e00fa55435a12.tar.gz
docgen: complete generic signatures for methods
-rw-r--r--gendoc.lua25
1 files changed, 23 insertions, 2 deletions
diff --git a/gendoc.lua b/gendoc.lua
index 2fba9d7b5c..5d23816822 100644
--- a/gendoc.lua
+++ b/gendoc.lua
@@ -960,7 +960,7 @@ local get_func_namesig = function(fn, cl, buf)
end
end
-local gen_func_param = function(fp, buf)
+local gen_func_param = function(fp, buf, nodir)
-- TODO: default value
buf[#buf + 1] = " "
local dirs = {
@@ -968,10 +968,16 @@ local gen_func_param = function(fp, buf)
[eolian.parameter_dir.OUT] = "@out ",
[eolian.parameter_dir.INOUT] = "@inout ",
}
- buf[#buf + 1] = dirs[fp:direction_get()]
+ if not nodir then buf[#buf + 1] = dirs[fp:direction_get()] end
buf[#buf + 1] = fp:name_get()
buf[#buf + 1] = ": "
buf[#buf + 1] = get_type_str(fp:type_get())
+ local dval = fp:default_value_get()
+ if dval then
+ buf[#buf + 1] = " ("
+ buf[#buf + 1] = dval:serialize()
+ buf[#buf + 1] = ")"
+ end
if fp:is_nonull() then
buf[#buf + 1] = " @nonull"
end
@@ -1005,6 +1011,21 @@ local get_method_sig = function(fn, cl)
end
buf[#buf + 1] = " }\n"
end
+ local rett = fn:return_type_get(eolian.function_type.METHOD)
+ if rett then
+ buf[#buf + 1] = " return: "
+ buf[#buf + 1] = get_type_str(rett)
+ local dval = fn:return_default_value_get(eolian.function_type.METHOD)
+ if dval then
+ buf[#buf + 1] = " ("
+ buf[#buf + 1] = dval:serialize()
+ buf[#buf + 1] = ")"
+ end
+ if fn:return_is_warn_unused(eolian.function_type.METHOD) then
+ buf[#buf + 1] = " @warn_unused"
+ end
+ buf[#buf + 1] = ";\n"
+ end
buf[#buf + 1] = "}"
return table.concat(buf)
end