summaryrefslogtreecommitdiff
path: root/lib/rdoc/parsers/parse_c.rb
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
commit349f4e7db766e618d606768d5ead8cbc9f4ef74f (patch)
tree37c299cb289d0563962400250d7f7b9a30a0986c /lib/rdoc/parsers/parse_c.rb
parent5e6d81e717879424edc46cda993799d8de7aa635 (diff)
Add RDoc for kernel functions, and tidy up
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers/parse_c.rb')
-rw-r--r--lib/rdoc/parsers/parse_c.rb45
1 files changed, 31 insertions, 14 deletions
diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb
index 2a735f6837..0ecd1ce39b 100644
--- a/lib/rdoc/parsers/parse_c.rb
+++ b/lib/rdoc/parsers/parse_c.rb
@@ -264,7 +264,10 @@ module RDoc
next if meth_name == "initialize_copy"
# Ignore top-object and weird struct.c dynamic stuff
- next if var_name == "ruby_top_self" || var_name == "nstr"
+ next if var_name == "ruby_top_self"
+ next if var_name == "nstr"
+ next if var_name == "envtbl"
+ next if var_name == "argf" # it'd be nice to handle this one
var_name = "rb_cObject" if var_name == "rb_mKernel"
handle_method(type, var_name, meth_name,
@@ -358,18 +361,7 @@ module RDoc
override_comment = find_override_comment(meth_obj.name)
comment = override_comment if override_comment
- #
- # If the comment block contains a section that looks like
- # call-seq:
- # Array.new
- # Array.new(10)
- # use it for the parameters
-
- if comment.sub!(/call-seq:(.*?)^\s*\*?\s*$/m, '')
- seq = $1
- seq.gsub!(/^\s*\*\s*/, '')
- meth_obj.call_seq = seq
- end
+ find_call_seq(comment, meth_obj) if comment
# meth_obj.params = params
meth_obj.start_collecting_tokens
@@ -377,7 +369,32 @@ module RDoc
meth_obj.comment = mangle_comment(comment)
else
- $stderr.puts "No definition for #{meth_name}"
+
+ # No body, but might still have an override comment
+ comment = find_override_comment(meth_obj.name)
+
+ if comment
+ find_call_seq(comment, meth_obj)
+ meth_obj.comment = mangle_comment(comment)
+ else
+ $stderr.puts "No definition for #{meth_name}"
+ end
+ end
+ end
+
+
+ ##################################################
+ #
+ # If the comment block contains a section that looks like
+ # call-seq:
+ # Array.new
+ # Array.new(10)
+ # use it for the parameters
+ def find_call_seq(comment, meth_obj)
+ if comment.sub!(/call-seq:(.*?)^\s*\*?\s*$/m, '')
+ seq = $1
+ seq.gsub!(/^\s*\*\s*/, '')
+ meth_obj.call_seq = seq
end
end