218 | 218 |
local this_mod
|
219 | 219 |
local items = self.items
|
220 | 220 |
local tagged_inside
|
221 | |
local function add_section (item, display_name)
|
222 | |
display_name = display_name or item.display_name
|
223 | |
this_mod.section = item
|
224 | |
this_mod.kinds:add_kind(display_name,display_name..' ',nil,item)
|
225 | |
this_mod.sections:append(item)
|
226 | |
this_mod.sections.by_name[display_name:gsub('%A','_')] = item
|
227 | |
end
|
228 | 221 |
for item in items:iter() do
|
229 | 222 |
if mod_section_type(this_mod) == 'factory' and item.tags then
|
230 | 223 |
local klass = '@{'..this_mod.section.name..'}'
|
|
288 | 281 |
display_name = summary
|
289 | 282 |
end
|
290 | 283 |
item.display_name = display_name
|
291 | |
--~ add_section(item)
|
292 | 284 |
this_mod.section = item
|
293 | 285 |
this_mod.kinds:add_kind(display_name,display_name..' ',nil,item)
|
294 | 286 |
this_mod.sections:append(item)
|
|
342 | 334 |
-- a class is either a @type section or a @classmod module. Is this a _method_?
|
343 | 335 |
local class = classmod and this_mod.name or this_section.name
|
344 | 336 |
local static = item.tags.constructor or item.tags.static or item.type ~= 'function'
|
345 | |
if classmod then -- methods and metamethods go into their own special sections...
|
|
337 |
-- methods and metamethods go into their own special sections...
|
|
338 |
if classmod and item.type == 'function' then
|
346 | 339 |
local inferred_section
|
347 | 340 |
if item.name:match '^__' then
|
348 | 341 |
inferred_section = 'Metamethods'
|
349 | 342 |
elseif not static then
|
350 | 343 |
inferred_section = 'Methods'
|
351 | 344 |
end
|
352 | |
if inferred_section then print('name',item.name,inferred_section)
|
|
345 |
if inferred_section then
|
353 | 346 |
item.tags.within = init_within_section(this_mod,inferred_section)
|
354 | 347 |
end
|
355 | 348 |
end
|
|
390 | 383 |
local these_items = this_mod.items
|
391 | 384 |
these_items.by_name[item.name] = item
|
392 | 385 |
these_items:append(item)
|
393 | |
--~ print(item.name,section_description,item.type)
|
394 | 386 |
this_mod.kinds:add(item,these_items,section_description)
|
395 | 387 |
end
|
396 | 388 |
|
|
1123 | 1115 |
return nil,"module not found: "..packmod
|
1124 | 1116 |
end
|
1125 | 1117 |
end
|
1126 | |
fun_ref = mod_ref.items.by_name[name]
|
|
1118 |
fun_ref = mod_ref:get_fun_ref(name)
|
1127 | 1119 |
if fun_ref then
|
1128 | 1120 |
return reference(s,mod_ref,fun_ref)
|
1129 | 1121 |
else
|
|
1137 | 1129 |
else -- plain jane name; module in this package, function in this module
|
1138 | 1130 |
mod_ref = modules.by_name[self.package..'.'..s]
|
1139 | 1131 |
if ismod(mod_ref) then return reference(s, mod_ref,nil) end
|
1140 | |
fun_ref = self.items.by_name[s]
|
1141 | |
-- did not get an exact match, so try to match by the unqualified fun name
|
1142 | |
if not fun_ref then
|
1143 | |
local patt = '[.:]'..s..'$'
|
1144 | |
for qname,ref in pairs(self.items.by_name) do
|
1145 | |
if qname:match(patt) then
|
1146 | |
fun_ref = ref
|
1147 | |
break
|
1148 | |
end
|
1149 | |
end
|
1150 | |
end
|
|
1132 |
fun_ref = self:get_fun_ref(s)
|
1151 | 1133 |
if fun_ref then return reference(s,self,fun_ref)
|
1152 | 1134 |
else
|
1153 | 1135 |
local ref = lua_manual_ref (s)
|
|
1156 | 1138 |
end
|
1157 | 1139 |
end
|
1158 | 1140 |
end
|
|
1141 |
|
|
1142 |
function Module:get_fun_ref(s)
|
|
1143 |
local fun_ref = self.items.by_name[s]
|
|
1144 |
-- did not get an exact match, so try to match by the unqualified fun name
|
|
1145 |
if not fun_ref then
|
|
1146 |
local patt = '[.:]'..s..'$'
|
|
1147 |
for qname,ref in pairs(self.items.by_name) do
|
|
1148 |
if qname:match(patt) then
|
|
1149 |
fun_ref = ref
|
|
1150 |
break
|
|
1151 |
end
|
|
1152 |
end
|
|
1153 |
end
|
|
1154 |
return fun_ref
|
|
1155 |
end
|
|
1156 |
|
1159 | 1157 |
|
1160 | 1158 |
-- resolving @see references. A word may be either a function in this module,
|
1161 | 1159 |
-- or a module in this package. A MOD.NAME reference is within this package.
|