summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
commite2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch)
tree942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/parser
parent90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff)
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r--lib/rdoc/parser/c.rb4
-rw-r--r--lib/rdoc/parser/ruby.rb15
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
index 60e9fefd61..db37985b6d 100644
--- a/lib/rdoc/parser/c.rb
+++ b/lib/rdoc/parser/c.rb
@@ -371,7 +371,7 @@ class RDoc::Parser::C < RDoc::Parser
def find_body(class_name, meth_name, meth_obj, body, quiet = false)
case body
- when %r%((?>/\*.*?\*/\s*))
+ when %r%((?>/\*.*?\*/\s*)?)
((?:(?:static|SWIGINTERN)\s+)?
(?:intern\s+)?VALUE\s+#{meth_name}
\s*(\([^)]*\))([^;]|$))%xm then
@@ -547,7 +547,7 @@ class RDoc::Parser::C < RDoc::Parser
# with ARGF at the same indent, but that are after the first description
# paragraph.
- if comment =~ /call-seq:(.*?[^\s\*].*?)^\s*\*?\s*$/m then
+ if comment =~ /call-seq:(.*?(?:\S|\*\/?).*?)^\s*(?:\*\/?)?\s*$/m then
all_start, all_stop = $~.offset(0)
seq_start, seq_stop = $~.offset(1)
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
index e6f07d66da..bec88bc52d 100644
--- a/lib/rdoc/parser/ruby.rb
+++ b/lib/rdoc/parser/ruby.rb
@@ -224,9 +224,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
##
# Look for a 'call-seq' in the comment, and override the normal parameter
# stuff
+ #--
+ # TODO handle undent
def extract_call_seq(comment, meth)
- if comment.sub!(/:?call-seq:(.*?)^\s*\#?\s*$/m, '') then
+ if comment.sub!(/:?call-seq:(.*?)(^\s*#?\s*$|\z)/m, '') then
seq = $1
seq.gsub!(/^\s*\#\s*/, '')
meth.call_seq = seq
@@ -779,6 +781,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
@stats.add_attribute att
end
+
+ true
end
##
@@ -1230,10 +1234,10 @@ class RDoc::Parser::Ruby < RDoc::Parser
if TkCOMMENT === tk then
if non_comment_seen then
# Look for RDoc in a comment about to be thrown away
- parse_comment container, tk, comment unless comment.empty?
+ non_comment_seen = parse_comment container, tk, comment unless
+ comment.empty?
comment = ''
- non_comment_seen = false
end
while TkCOMMENT === tk do
@@ -1360,6 +1364,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
return
end
+ else
+ non_comment_seen = parse_comment container, tk, comment unless
+ comment.empty?
+
+ comment = ''
end
comment = '' unless keep_comment