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:
parent
9f519d661c
commit
dcfe4ecff8
3 changed files with 19 additions and 0 deletions
|
@ -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>
|
||||
|
||||
* html_generator.rb: Support hyperlinks of the form {any text}[xxx]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue