try match single names against fully qualified names of module funtions

This commit is contained in:
Steve Donovan 2013-11-21 16:06:34 +02:00
parent feabf5c91a
commit 4fac99406c
1 changed files with 10 additions and 0 deletions

View File

@ -1114,6 +1114,16 @@ function Module:process_see_reference (s,modules,istype)
mod_ref = modules.by_name[self.package..'.'..s] mod_ref = modules.by_name[self.package..'.'..s]
if ismod(mod_ref) then return reference(s, mod_ref,nil) end if ismod(mod_ref) then return reference(s, mod_ref,nil) end
fun_ref = self.items.by_name[s] fun_ref = self.items.by_name[s]
-- did not get an exact match, so try to match by the unqualified fun name
if not fun_ref then
local patt = '[.:]'..s..'$'
for qname,ref in pairs(self.items.by_name) do
if qname:match(patt) then
fun_ref = ref
break
end
end
end
if fun_ref then return reference(s,self,fun_ref) if fun_ref then return reference(s,self,fun_ref)
else else
local ref = lua_manual_ref (s) local ref = lua_manual_ref (s)