summaryrefslogtreecommitdiffstats
path: root/lib
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
commitc0b046c230a350d1875dc2652562d028cdade7b0 (patch)
tree6c073a0a10fe9df88a46eb2226892335876b1d06 /lib
parent7d928400171385f7c5f2532c4b546e33ad5e78c7 (diff)
downloadruby-c0b046c230a350d1875dc2652562d028cdade7b0.tar.gz
ruby-c0b046c230a350d1875dc2652562d028cdade7b0.tar.xz
ruby-c0b046c230a350d1875dc2652562d028cdade7b0.zip
Don't include &block if we have yield parameters
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-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
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index 1d2e4d212..9bacab8f6 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 75b056b8b..13d63e5a3 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 6876cfe0f..1a3874fe2 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)