1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_s_quote): no longer takes optional second argument

that has never been documented.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-10-10 14:34:42 +00:00
parent ee624f97ac
commit 79a202433c
2 changed files with 11 additions and 19 deletions

View file

@ -1,3 +1,8 @@
Wed Oct 10 23:32:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_s_quote): no longer takes optional second argument
that has never been documented.
Wed Oct 10 15:39:04 2007 Tanaka Akira <akr@fsij.org>
* encoding.c (rb_enc_init): don't alias iso-8859-1 to ascii.

25
re.c
View file

@ -1972,21 +1972,9 @@ rb_reg_quote(VALUE str)
*/
static VALUE
rb_reg_s_quote(int argc, VALUE *argv)
rb_reg_s_quote(VALUE c, VALUE str)
{
VALUE str, kcode;
int kcode_saved = reg_kcode;
rb_scan_args(argc, argv, "11", &str, &kcode);
if (!NIL_P(kcode)) {
rb_set_kcode(StringValuePtr(kcode));
curr_kcode = reg_kcode;
reg_kcode = kcode_saved;
}
str = reg_operand(str, Qtrue);
str = rb_reg_quote(str);
kcode_reset_option();
return str;
return rb_reg_quote(reg_operand(str, Qtrue));
}
int
@ -2058,7 +2046,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
return v;
else {
VALUE args[1];
args[0] = rb_reg_s_quote(RARRAY_LEN(args0), RARRAY_PTR(args0));
args[0] = rb_reg_s_quote(Qnil, RARRAY_PTR(args0)[0]);
return rb_class_new_instance(1, args, rb_cRegexp);
}
}
@ -2089,8 +2077,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
v = rb_reg_to_s(v);
}
else {
args[0] = rb_ary_entry(args0, i);
v = rb_reg_s_quote(1, args);
v = rb_reg_s_quote(Qnil, rb_ary_entry(args0, i));
}
rb_str_buf_append(source, v);
}
@ -2424,8 +2411,8 @@ Init_Regexp(void)
rb_cRegexp = rb_define_class("Regexp", rb_cObject);
rb_define_alloc_func(rb_cRegexp, rb_reg_s_alloc);
rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1);
rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1);
rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1);
rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, 1);
rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, 1);
rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union_m, -2);
rb_define_singleton_method(rb_cRegexp, "last_match", rb_reg_s_last_match, -1);
rb_define_singleton_method(rb_cRegexp, "try_convert", rb_reg_s_try_convert, 1);