mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Search parent for unqualified constants
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c9d3f3dd8a
commit
9b7b6016ce
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/generators/html_generator.rb: Hack to search parents
|
||||
for unqualified constant names.
|
||||
|
||||
Mon May 10 01:18:15 2004 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* lib/net/pop.rb (loggin): append "\n".
|
||||
|
|
|
@ -73,6 +73,10 @@ module Generators
|
|||
def AllReferences.[](name)
|
||||
@@refs[name]
|
||||
end
|
||||
|
||||
def AllReferences.keys
|
||||
@@refs.keys
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -376,6 +380,10 @@ module Generators
|
|||
res = []
|
||||
array.each do |i|
|
||||
ref = AllReferences[i.name]
|
||||
if !ref && @context.parent
|
||||
name = @context.parent.name + "::" + i.name
|
||||
ref = AllReferences[name]
|
||||
end
|
||||
if !ref && block_given?
|
||||
possibles = yield(i.name)
|
||||
while !ref and !possibles.empty?
|
||||
|
|
Loading…
Reference in a new issue