fixed builtin/module ambiguity for perldoc

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-05-06 20:02:03 +00:00
parent 6fd4cb109f
commit 48571071c1
1 changed files with 10 additions and 9 deletions

View File

@ -257,15 +257,16 @@ class PerlViewWordPerldoc(Method):
w.application.set_error('invalid word: %r' % word)
return
# first try it is a package
parts = word.split('::')
while len(parts) > 0:
newword = '::'.join(parts)
data = self._try(w, newword, asfunc=False)
if data:
self._show(w, data, newword)
return
parts.pop(-1)
# first try it is a package, unless it's a builtin
if not token.name == "perl_builtin":
parts = word.split('::')
while len(parts) > 0:
newword = '::'.join(parts)
data = self._try(w, newword, asfunc=False)
if data:
self._show(w, data, newword)
return
parts.pop(-1)
# then try it as a function
data = self._try(w, word, asfunc=True)