summaryrefslogtreecommitdiff
path: root/lib/rdoc/parsers/parse_rb.rb
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
commitad27a1413640c63310da6c25b95bb6f2fad122be (patch)
treed0e88c277f191cb0c94801d2b2c60ab77888fe8f /lib/rdoc/parsers/parse_rb.rb
parent3d9ba0390c467353d2117d4dd990dcf3f6bea717 (diff)
Implicitly define classes in 'class <<ClassName' if we haven't come across them before
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers/parse_rb.rb')
-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 f127d8462e..43c9d26579 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