[前][次][番号順一覧][スレッド一覧]

ruby-changes:12502

From: tadf <ko1@a...>
Date: Sun, 19 Jul 2009 20:43:42 +0900 (JST)
Subject: [ruby-changes:12502] Ruby:r24205 (trunk): * complex.c (make_patterns): do not use \d.

tadf	2009-07-19 20:43:23 +0900 (Sun, 19 Jul 2009)

  New Revision: 24205

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24205

  Log:
    * complex.c (make_patterns): do not use \d.
    * rational.c (make_patterns): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c
    trunk/rational.c

Index: complex.c
===================================================================
--- complex.c	(revision 24204)
+++ complex.c	(revision 24205)
@@ -1406,7 +1406,7 @@
     null_string, underscores_pat, an_underscore;
 
 #define WS "\\s*"
-#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
+#define DIGITS "(?:[0-9](?:_[0-9]|[0-9])*)"
 #define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?"
 #define DENOMINATOR DIGITS
 #define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?"
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24204)
+++ ChangeLog	(revision 24205)
@@ -1,3 +1,9 @@
+Sun Jul 19 20:41:24 2009  Tadayoshi Funaba  <tadf@d...>
+
+	* complex.c (make_patterns): do not use \d.
+
+	* rational.c (make_patterns): ditto.
+
 Sun Jul 19 17:32:37 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (io_read): should taint the result.   [ruby-dev:38826]
Index: rational.c
===================================================================
--- rational.c	(revision 24204)
+++ rational.c	(revision 24205)
@@ -1723,7 +1723,7 @@
 static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore;
 
 #define WS "\\s*"
-#define DIGITS "(?:\\d(?:_\\d|\\d)*)"
+#define DIGITS "(?:[0-9](?:_[0-9]|[0-9])*)"
 #define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?"
 #define DENOMINATOR DIGITS
 #define PATTERN "\\A" WS "([-+])?(" NUMERATOR ")(?:\\/(" DENOMINATOR "))?" WS

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]