summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-05 17:02:47 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-05 17:02:47 +0000
commit45c79aacee8550f617a23eae444daea2765f8724 (patch)
tree4b15b45c3c5f08b4d669d83d52f97a749022384e
parent68696d07ba6e997d8f65734cb1d2f1d8361879eb (diff)
Don't include &block if we have yield parameters
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/rdoc/code_objects.rb6
-rw-r--r--lib/rdoc/generators/html_generator.rb5
-rw-r--r--lib/rdoc/parsers/parse_rb.rb1
4 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ae3ac6011..7b2c8becfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu May 6 01:59:04 2004 Dave Thomas <dave@pragprog.com>
+
+ * lib/rdoc/generators/html_generator.rb (Generators::HtmlMethod::params):
+ Don't include the &block parameter if we have explicit
+ yield parameters.
+
Wed May 5 03:40:29 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/ring.rb: use recv instead of recvfrom.
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index 1d2e4d2129..9bacab8f6d 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -597,6 +597,12 @@ module RDoc
p = "(" + p + ")" unless p[0] == ?(
if (block = block_params)
+ # If this method has explicit block parameters, remove any
+ # explicit &block
+$stderr.puts p
+ p.sub!(/,?\s*&\w+/)
+$stderr.puts p
+
block.gsub!(/\s*\#.*/, '')
block = block.tr("\n", " ").squeeze(" ")
if block[0] == ?(
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
index 75b056b8be..13d63e5a3c 100644
--- a/lib/rdoc/generators/html_generator.rb
+++ b/lib/rdoc/generators/html_generator.rb
@@ -922,6 +922,11 @@ module Generators
p = "(" + p + ")" unless p[0] == ?(
if (block = @context.block_params)
+ # If this method has explicit block parameters, remove any
+ # explicit &block
+
+ p.sub!(/,?\s*&\w+/, '')
+
block.gsub!(/\s*\#.*/, '')
block = block.tr("\n", " ").squeeze(" ")
if block[0] == ?(
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
index 6876cfe0fc..1a3874fe24 100644
--- a/lib/rdoc/parsers/parse_rb.rb
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -1968,6 +1968,7 @@ module RDoc
remove_token_listener(meth)
meth.comment = comment
+
end
def skip_method(container)