diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-15 23:00:21 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-15 23:00:21 +0000 |
commit | f4b52722aad5a8d2e9fc858d2f1c4147ab584d21 (patch) | |
tree | 6a9328c2147f991364e2e1d99abdad5c47da736f /lib/rdoc/parser/c.rb | |
parent | 366f2c1120653be5e08f1cc7452d3dbbe1b85f2b (diff) | |
download | ruby-f4b52722aad5a8d2e9fc858d2f1c4147ab584d21.tar.gz |
* lib/rdoc.rb: Update to RDoc 3.6.1, allows OpenSSL::Digest to be
found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/c.rb')
-rw-r--r-- | lib/rdoc/parser/c.rb | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index 0f2196b2e8..12efb407a2 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -218,13 +218,22 @@ class RDoc::Parser::C < RDoc::Parser handle_class_module(var_name, "module", class_name, nil, in_module) end - @content.scan(/([\w\.]+)\s* = \s*rb_define_class_under\s* - \( - \s*(\w+), - \s*"(\w+)", - \s*([\w\*\s\(\)\.\->]+)\s* # for SWIG - \s*\)/mx) do |var_name, in_module, class_name, parent| - handle_class_module(var_name, "class", class_name, parent, in_module) + @content.scan(/([\w\.]+)\s* = # var_name + \s*rb_define_class_under\s* + \( + \s* (\w+), # under + \s* "(\w+)", # class_name + \s* + (?: + ([\w\*\s\(\)\.\->]+) | # parent_name + rb_path2class\("([\w:]+)"\) # path + ) + \s* + \) + /mx) do |var_name, under, class_name, parent_name, path| + parent = path || parent_name + + handle_class_module var_name, 'class', class_name, parent, under end @content.scan(/([\w\.]+)\s* = \s*rb_singleton_class\s* @@ -650,8 +659,8 @@ class RDoc::Parser::C < RDoc::Parser enclosure = @classes[in_module] || @@enclosure_classes[in_module] if enclosure.nil? and enclosure = @known_classes[in_module] then - type = /^rb_m/ =~ in_module ? "module" : "class" - handle_class_module in_module, type, enclosure, nil, nil + enc_type = /^rb_m/ =~ in_module ? "module" : "class" + handle_class_module in_module, enc_type, enclosure, nil, nil enclosure = @classes[in_module] end @@ -675,17 +684,21 @@ class RDoc::Parser::C < RDoc::Parser end cm = enclosure.add_class RDoc::NormalClass, class_name, parent_name - - @stats.add_class cm else cm = enclosure.add_module RDoc::NormalModule, class_name - @stats.add_module cm end cm.record_location enclosure.top_level find_class_comment cm.full_name, cm + case cm + when RDoc::NormalClass + @stats.add_class cm + when RDoc::NormalModule + @stats.add_module cm + end + @classes[var_name] = cm @@enclosure_classes[var_name] = cm @known_classes[var_name] = cm.full_name |