1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Support call-seq: for Ruby methods

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
dave 2004-07-12 15:52:35 +00:00
parent 9f519d661c
commit dcfe4ecff8
3 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Tue Jul 13 00:50:48 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb: Support call-seq: for Ruby files.
2004-07-12 Dave Thomas <dave@pragprog.com> 2004-07-12 Dave Thomas <dave@pragprog.com>
* html_generator.rb: Support hyperlinks of the form {any text}[xxx] * html_generator.rb: Support hyperlinks of the form {any text}[xxx]

View file

@ -419,6 +419,11 @@ this margin are formatted verbatim.
12. Comment blocks can contain other directives: 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>] [<tt>:include:</tt><i>filename</i>]
include the contents of the named file at this point. The include the contents of the named file at this point. The
file will be searched for in the directories listed by file will be searched for in the directories listed by

View file

@ -1976,6 +1976,16 @@ module RDoc
remove_token_listener(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 meth.comment = comment
end end