summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-12 15:52:35 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-12 15:52:35 +0000
commit9b286027818a671ff2ae1554cb3d893719fdf6ab (patch)
treeafad2cf175047ae880b822a00bb6fefb3f2303cf /lib
parentd5933d275b096e4ef0998ef21d108e45747994b2 (diff)
downloadruby-9b286027818a671ff2ae1554cb3d893719fdf6ab.tar.gz
ruby-9b286027818a671ff2ae1554cb3d893719fdf6ab.tar.xz
ruby-9b286027818a671ff2ae1554cb3d893719fdf6ab.zip
Support call-seq: for Ruby methods
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/README5
-rw-r--r--lib/rdoc/parsers/parse_rb.rb10
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/rdoc/README b/lib/rdoc/README
index e13ab87dc..cfc99cb50 100644
--- a/lib/rdoc/README
+++ b/lib/rdoc/README
@@ -419,6 +419,11 @@ this margin are formatted verbatim.
12. Comment blocks can contain other directives:
+ [<tt>call-seq:</tt>]
+ lines up to the next blank line in the comment are treated as
+ the method's calling sequence, overriding the
+ default parsing of method parameters and yield arguments.
+
[<tt>:include:</tt><i>filename</i>]
include the contents of the named file at this point. The
file will be searched for in the directories listed by
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
index 70236af34..9f02dfd07 100644
--- a/lib/rdoc/parsers/parse_rb.rb
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -1975,6 +1975,16 @@ module RDoc
parse_statements(container, single, meth)
remove_token_listener(meth)
+
+ # Look for a 'call-seq' in the comment, and override the
+ # normal parameter stuff
+
+ if comment.sub!(/call-seq:(.*?)^\s*\#?\s*$/m, '')
+$stderr.puts $1
+ seq = $1
+ seq.gsub!(/^\s*\#\s*/, '')
+ meth.call_seq = seq
+ end
meth.comment = comment