fixed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5265458754
commit
4879ae65fd
27
complex.c
27
complex.c
@ -1132,7 +1132,7 @@ static VALUE comp_pat1, comp_pat2, a_slash, a_dot_and_an_e,
|
|||||||
#define DENOMINATOR "[-+]?" DIGITS
|
#define DENOMINATOR "[-+]?" DIGITS
|
||||||
#define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?"
|
#define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?"
|
||||||
#define NUMBERNOS NUMERATOR "(?:\\/" DENOMINATOR ")?"
|
#define NUMBERNOS NUMERATOR "(?:\\/" DENOMINATOR ")?"
|
||||||
#define PATTERN1 "\\A(" NUMBER "|\\(" NUMBER "\\))?[iIjJ]"
|
#define PATTERN1 "\\A((" NUMBER ")|\\((" NUMBER ")\\))?[iIjJ]"
|
||||||
#define PATTERN2 "\\A(" NUMBER ")(([-+])(?:(" NUMBERNOS ")|\\((" NUMBER ")\\))?[iIjJ])?"
|
#define PATTERN2 "\\A(" NUMBER ")(([-+])(?:(" NUMBERNOS ")|\\((" NUMBER ")\\))?[iIjJ])?"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1209,7 +1209,12 @@ string_to_c_internal(VALUE self)
|
|||||||
sr = Qnil;
|
sr = Qnil;
|
||||||
si = f_aref(m, INT2FIX(1));
|
si = f_aref(m, INT2FIX(1));
|
||||||
if (NIL_P(si))
|
if (NIL_P(si))
|
||||||
si = rb_str_new2("1");
|
si = rb_str_new2("1");
|
||||||
|
else {
|
||||||
|
si = f_aref(m, INT2FIX(2));
|
||||||
|
if (NIL_P(si))
|
||||||
|
si = f_aref(m, INT2FIX(3));
|
||||||
|
}
|
||||||
re = f_post_match(m);
|
re = f_post_match(m);
|
||||||
}
|
}
|
||||||
if (NIL_P(m)) {
|
if (NIL_P(m)) {
|
||||||
@ -1218,17 +1223,17 @@ string_to_c_internal(VALUE self)
|
|||||||
return rb_assoc_new(Qnil, self);
|
return rb_assoc_new(Qnil, self);
|
||||||
sr = f_aref(m, INT2FIX(1));
|
sr = f_aref(m, INT2FIX(1));
|
||||||
if (NIL_P(f_aref(m, INT2FIX(2))))
|
if (NIL_P(f_aref(m, INT2FIX(2))))
|
||||||
si = Qnil;
|
si = Qnil;
|
||||||
else {
|
else {
|
||||||
VALUE t;
|
VALUE t;
|
||||||
|
|
||||||
si = f_aref(m, INT2FIX(3));
|
si = f_aref(m, INT2FIX(3));
|
||||||
t = f_aref(m, INT2FIX(4));
|
t = f_aref(m, INT2FIX(4));
|
||||||
if (NIL_P(t))
|
if (NIL_P(t))
|
||||||
t = f_aref(m, INT2FIX(5));
|
t = f_aref(m, INT2FIX(5));
|
||||||
if (NIL_P(t))
|
if (NIL_P(t))
|
||||||
t = rb_str_new2("1");
|
t = rb_str_new2("1");
|
||||||
rb_str_concat(si, t);
|
rb_str_concat(si, t);
|
||||||
}
|
}
|
||||||
re = f_post_match(m);
|
re = f_post_match(m);
|
||||||
}
|
}
|
||||||
|
@ -1422,8 +1422,9 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass)
|
|||||||
{
|
{
|
||||||
VALUE a1, a2;
|
VALUE a1, a2;
|
||||||
|
|
||||||
if (rb_scan_args(argc, argv, "02", &a1, &a2) == 1)
|
a1 = Qnil;
|
||||||
a2 = ONE;
|
a2 = Qnil;
|
||||||
|
rb_scan_args(argc, argv, "02", &a1, &a2);
|
||||||
|
|
||||||
switch (TYPE(a1)) {
|
switch (TYPE(a1)) {
|
||||||
case T_COMPLEX:
|
case T_COMPLEX:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user