summaryrefslogtreecommitdiffstats
path: root/lib/rdoc/parsers
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-03 14:40:44 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-03 14:40:44 +0000
commit0d0c4be9181c0dbd07965ce353d0118312afc04f (patch)
treed0e88c277f191cb0c94801d2b2c60ab77888fe8f /lib/rdoc/parsers
parent4840d46e823b309c294b19722238e6b924a3b397 (diff)
downloadruby-0d0c4be9181c0dbd07965ce353d0118312afc04f.tar.gz
ruby-0d0c4be9181c0dbd07965ce353d0118312afc04f.tar.xz
ruby-0d0c4be9181c0dbd07965ce353d0118312afc04f.zip
Implicitly define classes in 'class <<ClassName' if we haven't come across them before
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers')
-rw-r--r--lib/rdoc/parsers/parse_rb.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
index f127d8462..43c9d2657 100644
--- a/lib/rdoc/parsers/parse_rb.rb
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -1733,7 +1733,11 @@ module RDoc
if name == container.name
parse_statements(container, SINGLE, &block)
else
- other = TopLevel.find_class_named(name) || Context.new
+ other = TopLevel.find_class_named(name)
+ unless other
+ other = @top_level.add_class(NormalClass, name, nil)
+ other.record_location(@top_level)
+ end
parse_statements(other, SINGLE, &block)
end
end