--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri 25 Feb 2005 at 10:43:53 +0900, Ian Macdonald wrote:

> If I'd actually waited for an answer to my question, I could have saved
> myself the work. :-)
> 
> In other words, I've spent the last half an hour tracing the problem and
> constructing the exact same patch you just posted.

Actually, my patch against 1.8.2 is ever so slightly different, so I
post it here for the convenience of others.

Ian
-- 
Ian Macdonald               | Someday you'll get your big chance -- or
System Administrator        | have you already had it? 
ian / caliban.org             | 
http://www.caliban.org      | 
                            | 

--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rdoc-space-before-paren.diff"

--- /usr/lib/ruby/1.8/rdoc/parsers/parse_c.rb	2004-09-08 19:48:32.000000000 -0700
+++ parse_c.rb	2005-02-24 17:57:38.602638528 -0800
@@ -249,13 +249,13 @@
     ############################################################
 
     def do_classes
-      @body.scan(/(\w+)\s*  s*rb_define_module\(\s*"(\w+)"\s*\)/mx) do 
+      @body.scan(/(\w+)\s*  s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do 
         |var_name, class_name|
         handle_class_module(var_name, "module", class_name, nil, nil)
       end
       
       # The '.' lets us handle SWIG-generated files
-      @body.scan(/([\w\.]+)\s*  s*rb_define_class
+      @body.scan(/([\w\.]+)\s*  s*rb_define_class\s*
                 \( 
                    \s*"(\w+)",
                    \s*(\w+)\s*
@@ -265,7 +265,7 @@
         handle_class_module(var_name, "class", class_name, parent, nil)
       end
       
-      @body.scan(/(\w+)\s**boot_defclass\(\s*"(\w+?)",\s*(\w+?)\)/) do
+      @body.scan(/(\w+)\s**boot_defclass\s*\(\s*"(\w+?)",\s*(\w+?)\)/) do
         |var_name, class_name, parent|
         parent  il if parent "0"
         handle_class_module(var_name, "class", class_name, parent, nil)
@@ -281,7 +281,7 @@
         handle_class_module(var_name, "module", class_name, nil, in_module)
       end
       
-      @body.scan(/([\w\.]+)\s*  s*rb_define_class_under
+      @body.scan(/([\w\.]+)\s*  s*rb_define_class_under\s*
                 \( 
                    \s*(\w+),
                    \s*"(\w+)",
@@ -305,7 +305,7 @@
                         module_function  |
                         private_method
                      )
-                     \(\s*([\w\.]+),
+                     \s*\(\s*([\w\.]+),
                        \s*"([^"]+)",
                        \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                        \s*(-?\w+)\s*\)
@@ -325,7 +325,7 @@
                       meth_body, param_count, source_file)
       end
 
-      @body.scan(%r{rb_define_global_function\(
+      @body.scan(%r{rb_define_global_function\s*\(
                                \s*"([^"]+)",
                                \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                                \s*(-?\w+)\s*\)
@@ -336,7 +336,7 @@
                       meth_body, param_count, source_file)
       end
   
-      @body.scan(/define_filetest_function\(
+      @body.scan(/define_filetest_function\s*\(
                                \s*"([^"]+)",
                                \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
                                \s*(-?\w+)\s*\)/xm) do  #"
@@ -350,7 +350,7 @@
     ############################################################
     
     def do_aliases
-      @body.scan(%r{rb_define_alias\(\s*(\w+),\s*"([^"]+)",\s*"([^"]+)"\s*\)}m) do
+      @body.scan(%r{rb_define_alias\s*\(\s*(\w+),\s*"([^"]+)",\s*"([^"]+)"\s*\)}m) do
         |var_name, new_name, old_name|
         @stats.num_methods + 
         class_name  known_classes[var_name] || var_name
@@ -482,7 +482,7 @@
     # Look for includes of the form
     #     rb_include_module(rb_cArray, rb_mEnumerable);
     def do_includes
-      @body.scan(/rb_include_module\(\s*(\w+?),\s*(\w+?)\s*\)/) do |c,m|
+      @body.scan(/rb_include_module\s*\(\s*(\w+?),\s*(\w+?)\s*\)/) do |c,m|
         if cls  classes[c]
           m  NOWN_CLASSES[m] || m
           cls.add_include(Include.new(m, ""))

--J2SCkAp4GZ/dPZZf--