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
|
@ -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…
Add table
Add a link
Reference in a new issue