mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (Init_Proc): make Method and UnboundMethod independent.
They are like instance and its class. [ruby-core:00941] * parse.y (yylex): disallow global variables like "$1ve". [ruby-core:00945] * marshal.c (marshal_dump): Marshal.dump(0, false) should cause an error. (ruby-bugs-ja PR#421) * regex.c (re_compile_pattern): warn if '-' is the edge of character range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6acc44d2e4
commit
ed0b577108
5 changed files with 29 additions and 6 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
Tue Apr 8 11:49:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (Init_Proc): make Method and UnboundMethod independent.
|
||||
They are like instance and its class. [ruby-core:00941]
|
||||
|
||||
* parse.y (yylex): disallow global variables like "$1ve".
|
||||
[ruby-core:00945]
|
||||
|
||||
* marshal.c (marshal_dump): Marshal.dump(0, false) should cause an
|
||||
error. (ruby-bugs-ja PR#421)
|
||||
|
||||
* regex.c (re_compile_pattern): warn if '-' is the edge of
|
||||
character range.
|
||||
|
||||
Mon Apr 7 15:49:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove struct
|
||||
|
|
10
eval.c
10
eval.c
|
@ -7452,10 +7452,16 @@ Init_Proc()
|
|||
rb_define_method(rb_cMethod, "unbind", method_unbind, 0);
|
||||
rb_define_method(rb_mKernel, "method", rb_obj_method, 1);
|
||||
|
||||
rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cMethod);
|
||||
rb_cUnboundMethod = rb_define_class("UnboundMethod", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cUnboundMethod);
|
||||
rb_undef_method(CLASS_OF(rb_cUnboundMethod), "new");
|
||||
rb_define_method(rb_cUnboundMethod, "==", method_eq, 1);
|
||||
rb_define_method(rb_cUnboundMethod, "clone", method_clone, 0);
|
||||
rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0);
|
||||
rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0);
|
||||
rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0);
|
||||
rb_define_method(rb_cUnboundMethod, "to_proc", umethod_proc, 0);
|
||||
rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1);
|
||||
rb_define_method(rb_cUnboundMethod, "unbind", umethod_unbind, 0);
|
||||
rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -589,19 +589,22 @@ marshal_dump(argc, argv)
|
|||
struct dump_arg arg;
|
||||
struct dump_call_arg c_arg;
|
||||
|
||||
port = 0;
|
||||
port = Qnil;
|
||||
rb_scan_args(argc, argv, "12", &obj, &a1, &a2);
|
||||
if (argc == 3) {
|
||||
if (!NIL_P(a2)) limit = NUM2INT(a2);
|
||||
if (NIL_P(a1)) goto type_error;
|
||||
port = a1;
|
||||
}
|
||||
else if (argc == 2) {
|
||||
if (FIXNUM_P(a1)) limit = FIX2INT(a1);
|
||||
else if (NIL_P(a1)) goto type_error;
|
||||
else port = a1;
|
||||
}
|
||||
arg.dest = 0;
|
||||
if (port) {
|
||||
if (!NIL_P(port)) {
|
||||
if (!rb_respond_to(port, s_write)) {
|
||||
type_error:
|
||||
rb_raise(rb_eTypeError, "instance of IO needed");
|
||||
}
|
||||
arg.str = rb_str_buf_new(0);
|
||||
|
|
2
parse.y
2
parse.y
|
@ -4246,8 +4246,6 @@ yylex()
|
|||
tokadd(c);
|
||||
c = nextc();
|
||||
} while (ISDIGIT(c));
|
||||
if (is_identchar(c))
|
||||
break;
|
||||
pushback(c);
|
||||
tokfix();
|
||||
yylval.node = NEW_NTH_REF(atoi(tok()+1));
|
||||
|
|
2
regex.c
2
regex.c
|
@ -1675,6 +1675,8 @@ re_compile_pattern(pattern, size, bufp)
|
|||
if (last > c)
|
||||
goto invalid_pattern;
|
||||
|
||||
if (last == '-' || c == '-')
|
||||
re_warning("character class has `-' without escape");
|
||||
range = 0;
|
||||
if (had_mbchar == 0) {
|
||||
for (;last<=c;last++)
|
||||
|
|
Loading…
Add table
Reference in a new issue