diff --git a/ChangeLog b/ChangeLog index 450bd86432..49d57e3748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jul 13 00:50:48 2004 Dave Thomas + + * lib/rdoc/parsers/parse_rb.rb: Support call-seq: for Ruby files. + 2004-07-12 Dave Thomas * html_generator.rb: Support hyperlinks of the form {any text}[xxx] diff --git a/lib/rdoc/README b/lib/rdoc/README index e13ab87dc8..cfc99cb50f 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: + [call-seq:] + 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. + [:include:filename] 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 70236af343..9f02dfd079 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