mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* struct.c (Init_Struct): should undefine "allocate" for Struct
class (it's redefined in the subclasses). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5db5aa2edb
commit
aac5ff0031
3 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Feb 14 14:13:16 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* struct.c (Init_Struct): should undefine "allocate" for Struct
|
||||||
|
class (it's redefined in the subclasses).
|
||||||
|
|
||||||
Wed Feb 13 17:58:12 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Wed Feb 13 17:58:12 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (stmt): local variable declaration order was changed
|
* parse.y (stmt): local variable declaration order was changed
|
||||||
|
|
1
parse.y
1
parse.y
|
@ -881,7 +881,6 @@ arg : lhs '=' arg
|
||||||
int need_negate = Qfalse;
|
int need_negate = Qfalse;
|
||||||
|
|
||||||
if (nd_type($1) == NODE_LIT) {
|
if (nd_type($1) == NODE_LIT) {
|
||||||
|
|
||||||
switch (TYPE($1->nd_lit)) {
|
switch (TYPE($1->nd_lit)) {
|
||||||
case T_FIXNUM:
|
case T_FIXNUM:
|
||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
|
|
3
struct.c
3
struct.c
|
@ -132,7 +132,7 @@ rb_struct_set(obj, val)
|
||||||
|
|
||||||
member = rb_struct_iv_get(rb_obj_class(obj), "__member__");
|
member = rb_struct_iv_get(rb_obj_class(obj), "__member__");
|
||||||
if (NIL_P(member)) {
|
if (NIL_P(member)) {
|
||||||
rb_bug("non-initialized struct");
|
rb_bug("uninitialized struct");
|
||||||
}
|
}
|
||||||
rb_struct_modify(obj);
|
rb_struct_modify(obj);
|
||||||
for (i=0; i<RARRAY(member)->len; i++) {
|
for (i=0; i<RARRAY(member)->len; i++) {
|
||||||
|
@ -568,6 +568,7 @@ Init_Struct()
|
||||||
rb_cStruct = rb_define_class("Struct", rb_cObject);
|
rb_cStruct = rb_define_class("Struct", rb_cObject);
|
||||||
rb_include_module(rb_cStruct, rb_mEnumerable);
|
rb_include_module(rb_cStruct, rb_mEnumerable);
|
||||||
|
|
||||||
|
rb_undef_method(CLASS_OF(rb_cStruct), "allocate");
|
||||||
rb_define_singleton_method(rb_cStruct, "new", rb_struct_s_def, -1);
|
rb_define_singleton_method(rb_cStruct, "new", rb_struct_s_def, -1);
|
||||||
|
|
||||||
rb_define_method(rb_cStruct, "initialize", rb_struct_initialize, -2);
|
rb_define_method(rb_cStruct, "initialize", rb_struct_initialize, -2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue