1 Aug 2004 10:30
[PATCH] parse_c.rb: allow whitespace after function names
Tilman Sauerbeck <tilman <at> code-monkey.de>
2004-08-01 08:30:47 GMT
2004-08-01 08:30:47 GMT
Hi,
here's a patch for rdoc (as shipped with ruby 1.8.1) that allows the
use of whitespace between a function name and the opening parenthesis,
like this:
rb_define_class_under (mFoo, "Bar", rb_cObject);
^
Without the patch, rdoc wouldn't recognize the class definition because
it expects the opening parenthesis to appear just after the function
name.
I know omitting the space before the parenthesis is "ruby style", but
IMHO it makes sense to allow it for C code.
Please comment.
--
--
Regards,
Tilman
diff -aur ruby-1.8.1.orig/lib/rdoc/parsers/parse_c.rb ruby-1.8.1/lib/rdoc/parsers/parse_c.rb
--- ruby-1.8.1.orig/lib/rdoc/parsers/parse_c.rb 2003-12-24 05:30:35.000000000 +0100
+++ ruby-1.8.1/lib/rdoc/parsers/parse_c.rb 2004-08-01 09:57:06.431256936 +0200
<at> <at> -194,13 +194,13 <at> <at>
end
def do_classes
- <at> body.scan(/(\w+)\s* = \s*rb_define_module\(\s*"(\w+)"\s*\)/mx) do
+ <at> body.scan(/(\w+)\s* = \s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do
(Continue reading)
RSS Feed