[#4076] Ruby/DL — Jamis Buck <jamis_buck@...>

I recently used Ruby/DL to create bindings to the SQLite3 embedded

40 messages 2005/01/03
[#4096] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/04

On Tue, Jan 04, 2005 at 02:53:49AM +0900, Jamis Buck wrote:

[#4099] Re: Ruby/DL — ts <decoux@...> 2005/01/04

>>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:

[#4119] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/05

On Wed, Jan 05, 2005 at 03:05:48AM +0900, ts wrote:

[#4120] Re: Ruby/DL — ts <decoux@...> 2005/01/05

>>>>> "P" == Paul Brannan <pbrannan@atdesk.com> writes:

[#4125] Re: Ruby/DL — Paul Brannan <pbrannan@...> 2005/01/05

On Thu, Jan 06, 2005 at 01:10:34AM +0900, ts wrote:

[#4116] Test::Unit::Collector::Dir won't work with code that modifies $LOAD_PATH — Eric Hodel <drbrain@...7.net>

Any test code that depends upon modifications of $: fails when used

10 messages 2005/01/05

[#4146] The face of Unicode support in the future — Charles O Nutter <headius@...>

Hello Rubyists!

47 messages 2005/01/06
[#4152] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/07

Hi,

[#4167] Re: The face of Unicode support in the future — Christian Neukirchen <chneukirchen@...> 2005/01/09

Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#4175] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/10

Hi,

[#4186] Re: The face of Unicode support in the future — Paul Brannan <pbrannan@...> 2005/01/11

On Mon, Jan 10, 2005 at 11:53:48PM +0900, Yukihiro Matsumoto wrote:

[#4192] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/12

Hi,

[#4269] Re: The face of Unicode support in the future — Wes Nakamura <wknaka@...>

19 messages 2005/01/18
[#4270] Re: The face of Unicode support in the future — Yukihiro Matsumoto <matz@...> 2005/01/18

Hi,

[#4275] Re: The face of Unicode support in the future — Wes Nakamura <wknaka@...> 2005/01/19

[#4323] test/unit doesn't rescue a Exception — Tanaka Akira <akr@...17n.org>

test/unit doesn't rescue a Exception in a test method, as follows.

14 messages 2005/01/27
[#8773] Re: test/unit doesn't rescue a Exception — Tanaka Akira <akr@...> 2006/09/02

In article <87is5jb46q.fsf@serein.a02.aist.go.jp>,

[#8776] Re: test/unit doesn't rescue a Exception — "Nathaniel Talbott" <ntalbott@...> 2006/09/03

On 9/1/06, Tanaka Akira <akr@fsij.org> wrote:

[#8777] Re: test/unit doesn't rescue a Exception — Eric Hodel <drbrain@...7.net> 2006/09/03

On Sep 2, 2006, at 6:34 PM, Nathaniel Talbott wrote:

[PATCH] parse_c.rb: allow whitespace after function names

From: Tilman Sauerbeck <tilman@...>
Date: 2005-01-20 17:48:55 UTC
List: ruby-core #4296
Hi,
I mailed this RDoc patch to ruby-doc a few months ago, but didn't get
any feedback, although parts of it have been applied to CVS it seems.

Is this the right mailing list for this kind of patch?

(Updated patch so it works with Ruby 1.8.2. Also, extra whitespace
before the *closing* parenthesis isn't accepted for
rb_define_filetest_function(), rb_define_global_function() and
rb_define_module_function() etc. cause I didn't understand the regex that's
used ;)

----- Forwarded message from Tilman Sauerbeck <tilman@code-monkey.de> -----

Date: Sun, 1 Aug 2004 10:30:47 +0200
From: Tilman Sauerbeck <tilman@code-monkey.de>
Reply-To: ruby-doc@ruby-lang.org
Subject: [PATCH] parse_c.rb: allow whitespace after function names
To: ruby-doc@ruby-lang.org
User-Agent: Mutt/1.4.2.1i

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

Attachments (1)

rdoc-allow_whitespace.diff (3.69 KB, text/x-diff)
diff -aur ruby-1.8.2.orig/lib/rdoc/parsers/parse_c.rb ruby-1.8.2/lib/rdoc/parsers/parse_c.rb
--- ruby-1.8.2.orig/lib/rdoc/parsers/parse_c.rb	2004-09-09 04:48:32.000000000 +0200
+++ ruby-1.8.2/lib/rdoc/parsers/parse_c.rb	2005-01-20 18:48:21.084557296 +0100
@@ -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*=\s*boot_defclass\(\s*"(\w+?)",\s*(\w+?)\)/) do
+      @body.scan(/(\w+)\s*=\s*boot_defclass\s*\(\s*"(\w+?)",\s*(\w+?)\s*\)/) do
         |var_name, class_name, parent|
         parent = nil if parent == "0"
         handle_class_module(var_name, "class", class_name, parent, nil)
@@ -281,12 +281,12 @@
         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+)",
                    \s*(\w+)\s*
-                \)/mx) do 
+                \s*\)/mx) do 
         
         |var_name, in_module, class_name, parent|
         handle_class_module(var_name, "class", class_name, parent, in_module)
@@ -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 += 1
         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 = KNOWN_CLASSES[m] || m
           cls.add_include(Include.new(m, ""))

In This Thread

Prev Next