a list of comma-separated items can appear after a see tag; fixed problem with references to Lua global functions from last commit
Steve Donovan
10 years ago
82 | 82 |
|
83 | 83 |
local function function_ref (name,tbl)
|
84 | 84 |
local href
|
85 | |
tbl = tbl or ''
|
86 | |
if tables[tbl] then
|
|
85 |
if not tbl then -- can only be a standard Lua global function
|
|
86 |
if globals.functions[name] then
|
|
87 |
return {href = fun_ref..name, label = name}
|
|
88 |
else
|
|
89 |
return nil
|
|
90 |
end
|
|
91 |
end
|
|
92 |
if tables[tbl] then -- function inside standard Lua table
|
87 | 93 |
name = tbl..'.'..name
|
88 | 94 |
href = fun_ref..name
|
89 | |
elseif xlibs[tbl] then
|
|
95 |
elseif xlibs[tbl] then -- in external libs, use LDoc style
|
90 | 96 |
href = xlib_url..xlibs[tbl]..'#'..name
|
91 | 97 |
name = tbl..'.'..name
|
92 | 98 |
else
|
|
97 | 103 |
|
98 | 104 |
local function module_ref (tbl)
|
99 | 105 |
local href
|
100 | |
if tables[tbl] ~= nil then
|
|
106 |
if tables[tbl] ~= nil then -- standard Lua table
|
101 | 107 |
href = manual..tables[tbl]
|
102 | |
elseif xlibs[tbl] then
|
|
108 |
elseif xlibs[tbl] then -- external lib
|
103 | 109 |
href = xlib_url..xlibs[tbl]
|
104 | 110 |
else
|
105 | 111 |
return nil
|
555 | 555 |
self.modifiers = extract_tag_modifiers(tags)
|
556 | 556 |
self.usage = read_del(tags,'usage')
|
557 | 557 |
tags.see = read_del(tags,'see')
|
|
558 |
if tags.see then
|
|
559 |
tags.see = tools.identifier_list(tags.see)
|
|
560 |
end
|
558 | 561 |
if doc.project_level(self.type) then
|
559 | 562 |
-- we are a module, so become one!
|
560 | 563 |
self.items = List()
|
169 | 169 |
|
170 | 170 |
function M.extract_identifier (value)
|
171 | 171 |
return value:match('([%.:%-_%w]+)(.*)$')
|
|
172 |
end
|
|
173 |
|
|
174 |
function M.identifier_list (ls)
|
|
175 |
local ns = List()
|
|
176 |
if type(ls) == 'string' then ls = List{ns} end
|
|
177 |
for s in ls:iter() do
|
|
178 |
if s:match ',' then
|
|
179 |
ns:extend(List.split(s,'[,%s]+'))
|
|
180 |
else
|
|
181 |
ns:append(s)
|
|
182 |
end
|
|
183 |
end
|
|
184 |
return ns
|
172 | 185 |
end
|
173 | 186 |
|
174 | 187 |
function M.strip (s)
|