From db4c0c32f0def494e351ca968dfaa67d1588b6a7 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 26 Feb 2012 10:33:38 -0500 Subject: Support multiple '@return' tags in Lua Adeptsense documentation. --- modules/textadept/adeptsense.lua | 3 ++- scripts/adeptsensedoc.lua | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua index d168c5a6..4e8d1286 100644 --- a/modules/textadept/adeptsense.lua +++ b/modules/textadept/adeptsense.lua @@ -338,7 +338,8 @@ M.FIELDS = '/* XPM */\nstatic char *field[] = {\n/* columns rows colors chars-pe -- caret. -- For example: `buffer.cur` would return `'buffer'` and `'cur'`. -- @param sense The Adeptsense returned by `adeptsense.new()`. --- @return symbol or `''`, part or `''`. +-- @return symbol or `''` +-- @return part or `''` -- @name get_symbol function M.get_symbol(sense) local line, p = buffer:get_cur_line() diff --git a/scripts/adeptsensedoc.lua b/scripts/adeptsensedoc.lua index 1f8cdcc3..cfae8898 100644 --- a/scripts/adeptsensedoc.lua +++ b/scripts/adeptsensedoc.lua @@ -64,7 +64,13 @@ local function write_apidoc(file, m, b) end end -- Function returns (@return). - if b.class == 'function' and b.ret then doc[#doc + 1] = '@return '..b.ret end + if b.class == 'function' and b.ret then + if type(b.ret) == 'string' then + doc[#doc + 1] = '@return '..b.ret + else + for _, u in ipairs(b.ret) do doc[#doc + 1] = '@return '..u end + end + end -- See also (@see). if b.see then if type(b.see) == 'string' then -- cgit v1.2.3