summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-14 00:39:16 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-14 00:39:16 +0000
commit0b6da24a5e24ff9ce8e153d2f073c2363e94b28e (patch)
tree95eb233fee15aae2fa2ba7dbeb1bb9c7bdfd9e1d /lib/rdoc/parser
parentfe89874540f5e95fbfd933a72fff2ad31b8e8d07 (diff)
* lib/rdoc.rb: Updated to RDoc 3.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r--lib/rdoc/parser/c.rb2
-rw-r--r--lib/rdoc/parser/ruby.rb35
2 files changed, 25 insertions, 12 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
index bb015690bd..0f2196b2e8 100644
--- a/lib/rdoc/parser/c.rb
+++ b/lib/rdoc/parser/c.rb
@@ -376,7 +376,7 @@ class RDoc::Parser::C < RDoc::Parser
when %r%((?>/\*.*?\*/\s*)?)
((?:(?:static|SWIGINTERN)\s+)?
(?:intern\s+)?VALUE\s+#{meth_name}
- \s*(\(.*?\))([^;]|$))%xm then
+ \s*(\([^)]*\))([^;]|$))%xm then
comment = $1
body = $2
offset = $~.offset(2).first
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
index bcf0ac1150..6bf1c8d308 100644
--- a/lib/rdoc/parser/ruby.rb
+++ b/lib/rdoc/parser/ruby.rb
@@ -1558,32 +1558,45 @@ class RDoc::Parser::Ruby < RDoc::Parser
when TkNL, TkUNLESS_MOD, TkIF_MOD, TkSEMICOLON then
container.ongoing_visibility = vis
else
- if vis_type == 'module_function' then
+ new_methods = []
+
+ case vis_type
+ when 'module_function' then
args = parse_symbol_arg
container.set_visibility_for args, :private, false
- module_functions = []
-
container.methods_matching args do |m|
s_m = m.dup
s_m.record_location @top_level
s_m.singleton = true
- s_m.visibility = :public
- module_functions << s_m
+ new_methods << s_m
end
+ when 'public_class_method', 'private_class_method' then
+ args = parse_symbol_arg
- module_functions.each do |s_m|
- case s_m
- when RDoc::AnyMethod then
- container.add_method s_m
- when RDoc::Attr then
- container.add_attribute s_m
+ container.methods_matching args, true do |m|
+ if m.parent != container then
+ m = m.dup
+ m.record_location @top_level
+ new_methods << m
end
+
+ m.visibility = vis
end
else
args = parse_symbol_arg
container.set_visibility_for args, vis, singleton
end
+
+ new_methods.each do |method|
+ case method
+ when RDoc::AnyMethod then
+ container.add_method method
+ when RDoc::Attr then
+ container.add_attribute method
+ end
+ method.visibility = vis
+ end
end
end