aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* * string.c (rb_str_resize): fix indent.nobu2007-07-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_rindex_m): accept string-like object convertiblenobu2007-07-161-39/+45
| | | | | | | with #to_str method, as well as rb_str_index_m. [ruby-core:11692] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_clear): need to check STR_EMBED_P() beforematz2007-06-261-1/+1
| | | | | | | free()ing memory. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>. [ruby-dev:31062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update document to follow MatchData#inspect implementation.akr2007-06-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): add optional argument to specifymatz2007-06-221-31/+30
| | | | | | | | | | exclusiveness. * range.c (range_step): use String#upto with optional argument. * range.c (range_each): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y, compile.c, gc.c, insns.def, intern.h, iseq.c, node.h,matz2007-02-231-28/+0
| | | | | | | | | | | object.c, string.c, variable.c, vm_macro.def: revert private instance variable feature, which is postponed until next major release. * marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to 8th version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ord): need not to check string length; ordmatz2007-02-231-5/+0
| | | | | | returns a codepoint for the first character in the string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (reg_operand): allow symbols to be operands for regularmatz2007-02-141-0/+8
| | | | | | | | | | | expression matches. * string.c (Init_String): allow Symbol#===. * lib/date/format.rb (Date::Format::Bag::to_hash): string added prefixes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_compose_ivar2): function to create a new ivar2matz2007-02-041-0/+28
| | | | | | | | | | | | | | | | | | | | symbol from a symbol and a class. back-ported from matzruby. * parse.y (rb_decompose_ivar2): reverse function of rb_compose_ivar2(). * marshal.c (w_symbol): support class local instance variables. * marshal.c (r_object0): ditto. * compile.c (defined_expr): ditto. * compile.c (iseq_compile_each): ditto. * insns.def: add two new instructions: getinstancevariable2 and setinstancevariable2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (SYMBOL_P): make Symbol immediate again for performance. matz2007-02-021-115/+105
| | | | | | | | | * string.c: redesign symbol methods. * parse.y (rb_id2str): store Strings for operator symbols. [ruby-dev:30235] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sub_bang): calling rb_str_modify() should be justusa2007-01-301-1/+1
| | | | | | | | before actually modifying the string. fixed: [ruby-dev:30211] (originally reported by zunda) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_proc.c (rb_proc_new): added.ko12007-01-161-4/+1
| | | | | | | | | | | * string.c (sym_to_proc): supported. * vm.c (invoke_block, th_invoke_yield, th_invoke_proc): fix to support rb_proc_new. * yarvcore.c: add a test code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): use RSTRING_LEN().matz2007-01-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): String#upto from empty string makesmatz2007-01-081-1/+1
| | | | | | inifinite loop. [ruby-core:09864] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-8/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ord): typo fixed. reported from Korneliusmatz2006-12-211-1/+1
| | | | | | Kalnbach <murphy@rubychan.de>. [ruby-core:09621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_slice_bang): rdoc description bug fixed.matz2006-12-211-4/+1
| | | | | | [ruby-core:09754] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_aset): index double decode problem.matz2006-12-111-1/+1
| | | | | | | [ruby-core:09695] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (Init_String): remove duplicated definition ofmatz2006-11-061-1/+0
| | | | | | | Symbol#to_s. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_dup_check): vid may be nameless internal id.matz2006-11-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: class Symbol is no longer subclass of String. alsomatz2006-11-021-1/+56
| | | | | | | covers [ruby-core:09366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (hash): use Bob Jenkins' hash algorithm.matz2006-11-011-88/+114
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upcase, rb_str_downcase, rb_str_downcase,matz2006-10-221-0/+8
| | | | | | | | | rb_str_upcase_bang, rb_str_downcase_bang, rb_str_swapcase_bang): add RDoc description that case conversion to be effective only in ASCII region. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_substr): should be infected with only originalnobu2006-10-221-4/+7
| | | | | | | | | | string, but not the shared string. fixed: [ruby-core:09152] * strnig.c (rb_str_new4): keep shared string untainted when orignal string is tainted. fixed: [ruby-dev:29672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_line): String#lines now works when a blockmatz2006-10-181-25/+20
| | | | | | | | | | is given. in other words, lines become an alias to each_line. [ruby-core:09218] * string.c (rb_str_each_byte): ditto for bytes in place of lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_lines): now takes optional argument for thematz2006-10-161-4/+4
| | | | | | | | | line separator. * io.c (rb_io_lines, rb_io_bytes): new methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_partition): RDoc update. a patch frommatz2006-10-121-5/+2
| | | | | | | | | Mauricio Fernandez <mfp at acm.org>. [ruby-core:09160] * hash.c (rb_hash_compare_by_id): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_scan): small documentation fix.matz2006-10-071-1/+1
| | | | | | | [ruby-core:09007] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_lines): returns an Enumerator instead of anmatz2006-10-021-23/+20
| | | | | | | | | array of lines. * string.c (rb_str_bytes): a new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_startwith): rename startwith? to start_with?,matz2006-09-271-6/+6
| | | | | | | endwith? to endwith?, respectively. [ruby-talk:216685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_shift): shift/unshift performance boost patch,matz2006-09-261-0/+8
| | | | | | | | | | | | | | | | | | | based on the patch from Eric Mahurin <eric_mahurin at yahoo.com>. [ruby-core:05861] * array.c (rb_ary_unshift_m): ditto. * array.c (ary_make_shared): ditto. * array.c (RESIZE_CAPA): ditto. * array.c (rb_ary_free): new function to free memory. code moved from gc.c. * string.c (rb_str_free): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_partition): no need to call rb_call_super(),matz2006-09-221-5/+2
| | | | | | | since String is no longer includes Enumerable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_new3): embed shorter strings more eagerly.matz2006-09-211-5/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_startwith): a new method to check if a stringmatz2006-09-211-1/+48
| | | | | | | | | starts with given prefix. * string.c (rb_str_endwith): the opposite of String#startwith?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (Init_String): Strings are no longer Enumerable. usematz2006-09-211-2/+0
| | | | | | | | | each_lines or lines method explicitly. * string.c (Init_String): remove each method. use each_lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_partition): RDoc typo fixed. [ruby-core:08898]matz2006-09-211-4/+4
| | | | | | | * string.c (rb_str_rpartition): fixed separation seek bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_lines): new method to split a string into lines.matz2006-09-211-0/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_partition): a new method to separate the stringmatz2006-09-201-1/+101
| | | | | | | | | by a separator. taken from Python 2.5. * string.c (rb_str_rpartition): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_eql): fail early to gain performance.matz2006-09-201-0/+46
| | | | | | | | | | | | | | * string.c (sym_hash): cache hash value in aux.shared if possible. * gc.c (rb_obj_id): no need to treat symbols specially. * lib/fileutils.rb (FileUtils::FileUtils): singleton_methods() no longer return an array of strings, but of symbols. * lib/delegate.rb (DelegateClass): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_intern): allow zero length symbols.matz2006-09-141-3/+0
| | | | | | | [ruby-core:08861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_intern): raise SecurityError only when $SAFEmatz2006-09-141-5/+3
| | | | | | | | | | | | level is greater than zero. [ruby-core:08862] * parse.y (rb_interned_p): new function to check if a string is already interned. * string.c (str_to_id): use rb_str_intern(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_intern): allow symbols to contains nul.matz2006-09-131-5/+4
| | | | | | | * string.c (sym_inspect): symbol may contain nul. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_intern): prohibit interning tainted string.matz2006-09-131-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_equal): "sym == str" should compare them asmatz2006-09-101-3/+5
| | | | | | | strings. [ruby-dev:29554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): test(0) should not have any specialmatz2006-09-091-4/+4
| | | | | | | | | meaning. [ruby-dev:29425] * file.c (rb_f_test): properer error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_alloc): should allocate a String object, even whenmatz2006-09-081-1/+3
| | | | | | | asked to allocate a Symbol object. [ruby-dev:29529] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_equal): override. check equivalence.matz2006-09-061-0/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (Init_String): undef Symbol#new.matz2006-09-021-2/+2
| | | | | | | * struct.c (rb_struct_s_def): wrong symbol detection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_to_id): a bug caused by premature optimization.matz2006-09-021-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e