summaryrefslogtreecommitdiffstats
path: root/class.c
Commit message (Collapse)AuthorAgeFilesLines
* * class.c (rb_mod_init_copy): fix memory leak of Class#dup.mame2009-11-141-0/+8
| | | | | | [ruby-dev:39687] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_class_new): move class check to rb_check_inheritable().matz2009-10-231-3/+3
| | | | | | | * class.c (rb_check_inheritable): should not allow subclass of class Class. [ruby-core:26225] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_obj_basic_to_s_p): typo. Please become familiar withusa2009-10-221-1/+1
| | | | | | | | the ANSI style. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_inspect): print instance variables only whenmatz2009-10-211-0/+10
| | | | | | | | Object#to_s is not overridden. [ruby-core:24425] * class.c (rb_obj_basic_to_s_p): new function. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (make_singleton_class): variable name changed.yugui2009-08-311-8/+3
| | | | | | removed an unnecessary conditional. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c: refactored singleton class related matters.yugui2009-08-311-74/+157
| | | | | | | | | | | | | | | | | | | | | | | | | Handles eigenclasses and plain classes transparently. (make_metaclass): renamed from make_metametaclass. (METACLASS_OF): new utility macro (META_CLASS_OF_CLASS_CLASS): ditto. (ENSURE_EIGENCLASS): ditto. (make_singleton_class): extracted from rb_singleton_class. (boot_defclass): moved from object.c (Init_class_hierarchy): extracted from Init_Object. (rb_make_metaclass): refactored. (singleton_class_of): extracted from rb_singleton_class. (rb_singleton_class): refactored. (rb_define_singleton_method): it needs a metaclass only but not its metametaclass. * object.c: booting class hierarchy was moved to class.c for keeping dependency between compilation units least. (Init_Object): extracting the booting into Init_class_hierarchy. (boot_defclass): moved to class.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Doxygen comment.yugui2009-08-291-0/+196
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-11/+8
| | | | | | | | | to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_module_id_under): fix the name.naruse2009-08-121-2/+2
| | | | | | * class.c (rb_define_module_under): fix for prevvious changes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_class_id_under, rb_define_module_id_under):nobu2009-08-121-8/+16
| | | | | | | | | | | | new functions to define a nested class/module with non-ascii name. * struct.c (make_struct): use name with encoding. * struct.c (inspect_struct): ditto. [ruby-core:24849] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-42/+23
| | | | | | | | | | | | | | | | | | | | | method management. This change affect some VM control stack structure. * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some refactoring. * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto. * vm_core.h, compile.c (iseq_specialized_instruction): remove VM_CALL_SEND_BIT. use another optimization tech for Kernel#send. * node.h: remove unused node types. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c: add mark/free functions for method entry. * include/ruby/intern.h: remove decl of rb_define_notimplement_method_id(). nobody can use it because noex is not opend. * iseq.c (iseq_mark): fix to check ic_method is available. * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Doxy-comments.yugui2009-06-291-0/+71
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (clone_method): add cast to remove warning frommatz2009-05-191-1/+1
| | | | | | rb_gc_write_barrier(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * struct.c (struct_ivar_get): new function to avoid repeatedmatz2009-05-191-1/+3
| | | | | | | | | | | | | | | rb_intern() calls. * struct.c (rb_struct_iv_get): use struct_ivar_get() * struct.c (num_members): ditto. * struct.c (rb_struct_s_members): ditto. * class.c (rb_singleton_class): cache symbol to reduce calls to rb_intern(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add longlife garbage collection. [ruby-dev:38423]nari2009-05-131-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (NORMAL_HEAPS_USED): new macro. (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto. (add_longlife_heaps_slot): new function. (rb_newobj_from_longlife_heap): ditto. (rb_newobj_longlife): ditto. (rb_node_newnode_longlife): ditto. (rb_gc_write_barrier): ditto. (remembered_set_recycle): ditto. (rb_gc_mark_remembered_set): ditto. (clear_mark_longlife_heaps): ditto. (gc_sweep_for_longlife): ditto. (assign_heap_slot): new argumnent to longlife heaps slot. (add_freelist): ditto. (gc_sweep): avoid lonlife heap slot. set longlife_collection flag at add heap. (rb_gc_force_recycle): avoid mark object and remembered_set object. (garbage_collect): add longlife collection. (rb_gc_start): invoke longlife collection. (gc_profile_record_get): for longlife collction profile. (gc_profile_result): ditto. * include/ruby/intern.h (rb_gc_write_barrier): declared. * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED. * debug.c (FL_REMEMBERED_SET): ditto. * insns.def (setinlinecache): insert write barrier. * vm_insnhelper.c (vm_method_search): ditto. * set_relation (set_relation): use longlife object. * vm.c (vm_define_method): ditto. * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto. * vm_method.c (rb_add_method): ditto. * class.c (rb_add_method): ditto. * node.h (NEW_NODE_LONGLIFE): new macro. (rb_node_newnode_longlife): declared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_method_id): use rb_define_notimplement_method_idakr2009-04-161-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | if rb_f_notimplement is given. (rb_define_protected_method): ditto. (rb_define_private_method): ditto. (rb_define_method): use rb_define_method_id. * include/ruby/intern.h (rb_f_notimplement): declared. (rb_define_notimplement_method_id): declared. * proc.c (method_inspect): show not-implemented. * vm_method.c (notimplement_body): new variable. (rb_notimplement_body_p): new function. (rb_method_boundp): return false if not implemented. (rb_f_notimplement): new function. (rb_define_notimplement_method_id): new function. * process.c (rb_f_fork): use rb_f_notimplement if not implemented. * file.c (rb_file_s_lchmod): use rb_f_notimplement if not implemented. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c: fixed indent.nobu2009-03-131-21/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args): Allow specifying the number of trailingknu2009-02-241-0/+6
| | | | | | | | | | mandatory arguments right after the number of optional arguments only if the number of leading mandatory arguments is not omitted. * ext/socket/tcpserver.c (tcp_svr_init): Make use of it. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args): Revamp rb_scan_args() to compute theknu2009-02-241-78/+68
| | | | | | | | number of required and optional arguments precisely to prepare for a more informative error message. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-31/+31
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args), README.EXT, README.EXT.ja: Add supportknu2009-02-161-16/+49
| | | | | | | | | | for specifying the number of the trailing mandatory arguments. Update the documents accordingly. [ruby-dev:37995] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_metaclass.rb: new test case for metaclass hierarchy.yugui2008-12-151-20/+43
| | | | | | | | | | | | | | | | | | | | * class.c (make_metametaclass): new function. extracted from rb_make_metaclass. * class.c (rb_make_metaclass): uses make_metametaclass when called for a metaclass. * class.c (rb_singleton_class): creates a meta^(n+2)-class in addition to a meta^(n+1)-class when called for a meta^(n)-class. This is because the returned meta^(n+1) class must acts as an instance of Class, metaclass of Class, ..., meta^(n+1)-class of Class, Module, metaclass of Module, ..., meta^(n+1)-class of Module, Object, metaclass of Object, ..., meta^(n+2)-class of Object, BasicObject, metaclass of BasicObject, ..., meta^(n+2)-class of and BasicObject even when Class, Module, Object or BasicObject has not have its meta^(i)-class yet. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_class_instance_methods): rdoc fixed. [ruby-core:19458]matz2008-10-231-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_make_metaclass): [BUG] Fixed a bus erroryugui2008-09-251-2/+7
| | | | | | | on the case for metaclass of a class which includes a module. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_make_metaclass): Made class of class of classyugui2008-09-251-1/+14
| | | | | | | | from Class into its own eigenclass. Now meta^(n)-class hierarchy regresses infinitely, again. (This feature was decided on developer-meeting-20080922.) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+1
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, vm_core.h: move decl of rb_iseq_clone() to class.c.ko12008-09-231-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, vm_core.h: move definition ofko12008-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-3/+0
| | | | | | | | | | | | | | | * common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c, io.c, process.c, signal.c: vm_core.h: ditto. Some unused external global variables are also removed. (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending, rb_thread_critical) * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c, ext/readline/readline.c, ext/socket/depend, ext/socket/socket.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-1/+7
| | | | | | | | | | | | | | | (rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (clone_method): should copy cbase in cref as well.matz2008-08-111-1/+9
| | | | | | | | | | | | | [ruby-dev:35116] * iseq.c (iseq_mark): mark original iseq object. * iseq.c (iseq_free): do not free internal data if they have original iseq to belong. * iseq.c (rb_iseq_clone): a new function to clone iseq value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-4/+8
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz2008-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h (NOEX_LOCAL): remove unused local visibility.matz2007-10-111-20/+0
| | | | | | | | * class.c (ins_methods_push): ditto. * class.c (rb_class_local_methods): method removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: export rb_ivar_foreach.akr2007-09-281-57/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/ruby/ruby.h: modify struct RObject and RClass for optimizing T_OBJECT space. [ruby-dev:31853] (ROBJECT_LEN, ROBJECT_PTR) (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL) (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor defined. * variable.c: support the modified RObject and RClass. * object.c: ditto. * class.c: ditto. * gc.c: ditto. * marshal.c: ditto. * eval_method.ci: use the abstract accessor. * insns.def: ditto. * proc.c: ditto. * struct.c: ditto. * eval.c: ditto. * error.c: ditto. * vm.c: ditto. * insnhelper.ci: ditto. * ext/digest/digest.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: provide basic features for M17N.matz2007-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-4/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-26/+55
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_include_module): revert duplicate inclusion ofmatz2006-11-071-3/+21
| | | | | | | modules. [ruby-dev:29793] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_include_module): remove unnecessary check.matz2006-10-061-3/+0
| | | | | | | [ruby-talk:218402] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): move symbol related code to string.cmatz2006-09-021-1/+1
| | | | | | | | | | | | * string.c (Init_String): Symbol as subclass of String. * parse.y (rb_intern2): handle symbol as strings. * string.c (str_new): substring of symbols are mere strings, not symbols. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): allow %c to print one charactermatz2006-06-091-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | string (e.g. ?x). * lib/tempfile.rb (Tempfile::make_tmpname): put dot between basename and pid. [ruby-talk:196272] * parse.y (do_block): remove -> style block. * parse.y (parser_yylex): remove tLAMBDA_ARG. * eval.c (rb_call0): binding for the return event hook should have consistent scope. [ruby-core:07928] * eval.c (proc_invoke): return behavior should depend whether it is surrounded by a lambda or a mere block. * eval.c (formal_assign): handles post splat arguments. * eval.c (rb_call0): ditto. * st.c (strhash): use FNV-1a hash. * parse.y (parser_yylex): removed experimental ';;' terminator. * eval.c (rb_node_arity): should be aware of post splat arguments. * eval.c (rb_proc_arity): ditto. * parse.y (f_args): syntax rule enhanced to support arguments after the splat. * parse.y (block_param): ditto for block parameters. * parse.y (f_post_arg): mandatory formal arguments after the splat argument. * parse.y (new_args_gen): generate nodes for mandatory formal arguments after the splat argument. * eval.c (rb_eval): dispatch mandatory formal arguments after the splat argument. * parse.y (args): allow more than one splat in the argument list. * parse.y (method_call): allow aref [] to accept all kind of method argument, including assocs, splat, and block argument. * eval.c (SETUP_ARGS0): prepare block argument as well. * lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931] * eval.c (error_line): print receivers true/false/nil specially. * eval.c (rb_proc_yield): handles parameters in yield semantics. * eval.c (nil_yield): gives LocalJumpError to denote no block error. * io.c (rb_io_getc): now takes one-character string. * string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo hashing algorithm. * string.c (rb_str_aref): str[0] now returns 1 character string, instead of a fixnum. [Ruby2] * parse.y (parser_yylex): ?c now returns 1 character string, instead of a fixnum. [Ruby2] * string.c (rb_str_aset): no longer support fixnum insertion. * eval.c (umethod_bind): should not update original class. [ruby-dev:28636] * eval.c (ev_const_get): should support constant access from within instance_eval(). [ruby-dev:28327] * time.c (time_timeval): should round for usec floating number. [ruby-core:07896] * time.c (time_add): ditto. * dir.c (sys_warning): should not call a vararg function rb_sys_warning() indirectly. [ruby-core:07886] * numeric.c (flo_divmod): the first element of Float#divmod should be an integer. [ruby-dev:28589] * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder. * re.c (rb_reg_initialize): should not allow modifying literal regexps. frozen check moved from rb_reg_initialize_m as well. * re.c (rb_reg_initialize): should not modify untainted objects in safe levels higher than 3. * re.c (rb_memcmp): type change from char* to const void*. * dir.c (dir_close): should not close untainted dir stream. * dir.c (GetDIR): add tainted/frozen check for each dir operation. * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg): typo fixed. a patch from Florian Gross <florg at florg.net>. * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from event_hooks. no guarantee for arbitrary hook deletion. [ruby-dev:28632] * util.c (ruby_strtod): differ addition to minimize error. [ruby-dev:28619] * util.c (ruby_strtod): should not raise ERANGE when the input string does not have any digits. [ruby-dev:28629] * eval.c (proc_invoke): should restore old ruby_frame->block. thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833] also fix [ruby-dev:28614] as well. * signal.c (trap): sig should be less then NSIG. Coverity found this bug. a patch from Kevin Tew <tewk at tewk.com>. [ruby-core:07823] * math.c (math_log2): add new method inspired by [ruby-talk:191237]. * math.c (math_log): add optional base argument to Math::log(). [ruby-talk:191308] * ext/syck/emitter.c (syck_scan_scalar): avoid accessing uninitialized array element. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07809] * array.c (rb_ary_fill): initialize local variables first. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810] * ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free type_tag. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07808] * ext/socket/socket.c (make_hostent_internal): accept ai_family check from Sam Roberts <sroberts at uniserve.com>. [ruby-core:07691] * util.c (ruby_strtod): should not cut off 18 digits for no reason. [ruby-core:07796] * array.c (rb_ary_fill): internalize local variable "beg" to pacify Coverity. [ruby-core:07770] * pack.c (pack_unpack): now supports CRLF newlines. a patch from <tommy at tmtm.org>. [ruby-dev:28601] * applied code clean-up patch from Stefan Huehner <stefan at huehner.org>. [ruby-core:07764] * lib/jcode.rb (String::tr_s): should have translated non squeezing character sequence (i.e. a character) as well. thanks to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090] * ext/socket/socket.c: document update patch from Sam Roberts <sroberts at uniserve.com>. [ruby-core:07701] * lib/mathn.rb (Integer): need not to remove gcd2. a patch from NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570] * parse.y (arg): too much NEW_LIST() * eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen. * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1. [ruby-dev:28585] * parse.y (arg): use NODE_ARGSCAT for placeholder. * lib/getoptlong.rb (GetoptLong::get): RDoc update patch from mathew <meta at pobox.com>. [ruby-core:07738] * variable.c (rb_const_set): raise error when no target klass is supplied. [ruby-dev:28582] * prec.c (prec_prec_f): documentation patch from <gerardo.santana at gmail.com>. [ruby-core:07689] * bignum.c (rb_big_pow): second operand may be too big even if it's a Fixnum. [ruby-talk:187984] * README.EXT: update symbol description. [ruby-talk:188104] * COPYING: explicitly note GPLv2. [ruby-talk:187922] * parse.y: remove some obsolete syntax rules (unparenthesized method calls in argument list). * eval.c (rb_call0): insecure calling should be checked for non NODE_SCOPE method invocations too. * eval.c (rb_alias): should preserve the current safe level as well as method definition. * process.c (rb_f_sleep): remove RDoc description about SIGALRM which is not valid on the current implementation. [ruby-dev:28464] Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp> * eval.c (method_missing): should support argument splat in super. a bug in combination of super, splat and method_missing. [ruby-talk:185438] * configure.in: Solaris SunPro compiler -rapth patch from <kuwa at labs.fujitsu.com>. [ruby-dev:28443] * configure.in: remove enable_rpath=no for Solaris. [ruby-dev:28440] * ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby String object. * ruby.1: a clarification patch from David Lutterkort <dlutter at redhat.com>. [ruby-core:7508] * lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems directories. a patch from Eric Hodel <drbrain at segment7.net>. [ruby-core:07423] * eval.c (rb_clear_cache_by_class): clearing wrong cache. * ext/extmk.rb: use :remove_destination to install extension libraries to avoid SEGV. [ruby-dev:28417] * eval.c (rb_thread_fd_writable): should not re-schedule output from KILLED thread (must be error printing). * array.c (rb_ary_flatten_bang): allow specifying recursion level. [ruby-talk:182170] * array.c (rb_ary_flatten): ditto. * gc.c (add_heap): a heap_slots may overflow. a patch from Stefan Weil <weil at mail.berlios.de>. * eval.c (rb_call): use separate cache for fcall/vcall invocation. * eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local functions. * eval.c (rb_mod_local): a new method to specify newly added visibility "local". * eval.c (search_method): search for local methods which are visible only from the current class. * class.c (rb_class_local_methods): a method to list local methods. * object.c (Init_Object): add BasicObject class as a top level BlankSlate class. * ruby.h (SYM2ID): should not cast to signed long. [ruby-core:07414] * class.c (rb_include_module): allow module duplication. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, eval.c, hash.c, st.c, variable.c: changed /* ??? */ stuffocean2005-10-201-7/+7
| | | | | | | protoize generated to ANYARGS. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: moved to ANSI function style from K&R function style.ocean2005-09-121-162/+46
| | | | | | | | | | | | | | | | | (used protoize on windows, so still K&R remains on #ifdef part of other platforms. And `foo _((boo))' stuff is still there) [ruby-dev:26975] * bignum.c, class.c, compar.c, dir.c, dln.c, dmyext.c, enum.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, main.c, marshal.c, math.c, numeric.c, object.c, pack.c, prec.c, process.c, random.c, range.c, re.c, regcomp.c, regenc.c, regerror.c, regexec.c, regparse.c, regparse.h, ruby.c, signal.c, sprintf.c, st.c, string.c, struct.c, time.c, util.h, variable.c, version.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/observer.rb: a patch from nornagon <nornagon@gmail.com>matz2005-09-051-1/+2
| | | | | | | | | | | merged to allow arbitrary names for update methods. [ruby-core:05416] * eval.c (rb_f_fcall): new method to avoid inefficiency of obj.instance_eval{send(...)} tricks. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_class_init_copy): singleton class is disallowed to copy,nobu2005-05-161-0/+3
| | | | | | | from its definition. fixed: [ruby-talk:142749] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e