summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
2008-02-16* string.c (rb_str_sub_bang): stringize replacing hash values.akr
(str_gsub): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-16* string.c (rb_enc_strlen): add search_nonascii like characternaruse
counter for UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-16* encoding.c (rb_enc_strlen): moved to string.c.akr
* string.c (rb_enc_strlen): use search_nonascii. (str_strlen): don't use search_nonascii. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* string.c (single_byte_optimizable): rb_enc_mbminlen must be 1naruse
when rb_enc_mbmaxlen is 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* encoding.c (rb_enc_nth): moved to string.c.akr
* string.c (rb_enc_nth): moved from string.c. use search_nonascii for ASCII compatible string. (str_nth): wrong optimization removed to fix "a".force_encoding("EUC-JP").slice!(0,10) returns "a\x00\x00\x00\x00\x00\x00\x00\x00\x00" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* string.c (rb_str_sub_bang, str_gsub): allows hash for replacement.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* string.c (str_strlen): use search_nonascii() for performance.matz
* string.c (str_nth): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* string.c (rb_str_getbyte): new method.akr
(rb_str_setbyte): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12* string.c (rb_str_hash_cmp): lighter version of rb_str_cmp() formatz
hash comparison function. * hash.c (rb_any_cmp): use rb_str_hash_cmp(). * string.c (rb_str_casecmp): should return nil for incompatible comparison. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-11* range.c (range_include): specialize single character stringmatz
case (e.g. (?a ..?z).include(?x)) for performance. [ruby-core:15481] * string.c (rb_str_upto): specialize single character case. * string.c (rb_str_hash): omit coderange scan for performance. * object.c (rb_check_to_integer): check Fixnum first. * object.c (rb_to_integer): ditto. * string.c (rb_str_equal): inline memcmp to avoid unnecessary rb_str_comparable(). * parse.y (rb_intern2): use US-ASCII encoding. * parse.y (rb_intern_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-09* string.c (rb_str_new4): copy encoding from orig, instead of sharedakr
one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-07* string.c (rb_str_replace): makes frozen shared string beforenobu
sharing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-07* string.c (rb_str_dup): reverted unneeded change. [ruby-dev:33634]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-07* string.c (str_replace_shared): replaces string with sharing.nobu
* string.c (rb_str_new4, rb_str_associate, rb_str_associated): allows associated strings shared. * string.c (rb_str_dup, rb_str_substr, rb_str_replace): shares memory. [ruby-core:15400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-07* string.c (rb_str_end_with): compares with the suffix.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-30* string.c (rb_str_succ): use wrapped character as a carry forakr
ASCII incompatible encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-28* string.c, parse.y, re.c: use rb_ascii8bit_encoding.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27* include/ruby/oniguruma.h: precise mbclen API redesigned to avoidakr
inline functions. (onigenc_mbclen_charfound): removed. (onigenc_mbclen_needmore): removed. (onigenc_mbclen_recover): removed. (ONIGENC_MBCLEN_CHARFOUND): removed. (ONIGENC_MBCLEN_CHARFOUND_P): defined. (ONIGENC_MBCLEN_CHARFOUND_LEN): defined. (ONIGENC_MBCLEN_INVALID): removed. (ONIGENC_MBCLEN_INVALID_P): defined. (ONIGENC_MBCLEN_NEEDMORE): removed. (ONIGENC_MBCLEN_NEEDMORE_P): defined. (ONIGENC_MBCLEN_NEEDMORE_LEN): defined. (ONIGENC_MBC_ENC_LEN): use onigenc_mbclen_approximate. * regenc.c (onigenc_mbclen_approximate): defined. * include/ruby/encoding.h (MBCLEN_CHARFOUND): removed. (MBCLEN_INVALID): removed. (MBCLEN_NEEDMORE): removed. (MBCLEN_CHARFOUND_P): defined. (MBCLEN_INVALID_P): defined. (MBCLEN_NEEDMORE_P): defined. (MBCLEN_CHARFOUND_LEN): defined. (MBCLEN_NEEDMORE_LEN): defined. * encoding.c: use new API. * re.c: ditto. * string.c: ditto. * parse.y: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27* string.c (rb_str_inspect): avoid exception byakr
"\#\xa1".force_encoding("euc-jp").inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27* string.c (rb_str_succ): warning suppressed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27* string.c (rb_str_succ): don't increment/decrement codepoint.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-26* string.c (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT whennaruse
empty string (len == 0). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* string.c (rb_str_usascii_new{,2}: defined.naruse
(rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when empty string. * encoding.c (rb_usascii_encoding, rb_usascii_encindex): defined. (rb_enc_inspect, enc_name, rb_locale_charmap, rb_enc_name_list_i): use rb_str_ascii_new. * array.c (recursive_join, inspect_ary): ditto. * object.c (nil_to_s, nil_inspect, true_to_s, false_to_s, rb_mod_to_s): ditto. * hash.c (inspect_hash, rb_hash_inspect, rb_f_getenv, env_fetch, env_clear, env_to_s, env_inspect): ditto. * numeric.c (flo_to_s, int_chr, rb_fix2str): ditto. * bignum.c (rb_big2str): ditto. * file.c (rb_file_ftype, rb_file_s_dirname, rb_file_s_extname, file_inspect_join, Init_file): ditto. * test/ruby/test_ruby_m17n.rb: add checks for encoding of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* string.c (rb_str_buf_cat_ascii): use rb_enc_cr_str_buf_cat.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* include/ruby/intern.h (rb_str_buf_cat_ascii): declared.akr
* string.c (rb_str_buf_cat_ascii): defined. * re.c (rb_reg_s_union): use rb_str_buf_cat_ascii to support ASCII incompatible encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-24* string.c (rb_enc_cr_str_buf_cat): ASCII incompatible encoding isakr
not compatible with any other encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* string.c (rb_str_each_line): use memchr(3) for faster newlinematz
search. * io.c (appendline): remove unused arguments * io.c (rb_io_getline_fast): make much simpler (and faster). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* string.c (str_make_independent): should set length.nobu
* string.c (rb_str_associate): hide associated array from ObjectSpace. * string.c (rb_str_associated): return associated array with freezing instead of false. [ruby-dev:33282] * string.c (rb_str_freeze): freeze associated array together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* string.c (str_mod_check, str_nth, str_offset): consitfied.nobu
* string.c (rb_str_dump): dump in ASCII-8BIT always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-22* configure.in (MINIRUBY): remove -I$(EXTOUT)/$(arch) frommatz
MINIRUBY since miniruby might not be able to load DLL. * test/ruby/test_m17n.rb: move tests from bootstrap test. * encoding.c (enc_find): should check name if ASCII compatible. * string.c (rb_str_end_with): should check character boundary. * encoding.c (rb_enc_compatible): encoding must be ASCII compatible before checking ENC_CODERANGE_7BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-22* string.c (rb_str_each_char): iterates over a shadow.nobu
[ruby-dev:33243] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-21* parse.y (rb_intern3): do not call rb_enc_mbclen() if *m ismatz
ASCII. [ruby-talk:287225] * string.c (rb_str_each_line): use rb_enc_is_newline() to gain performance if the record separator ($/) is not modified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-21* string.c (rb_str_each_char): move forward. [ruby-dev:33231]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-20* string.c (rb_str_each_char): advance offset before get next charnobu
length. [ruby-dev:33211] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-20* string.c (rb_str_each_char): performance improvement, and stop ifnobu
shortened in the block. [ruby-dev:33189] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-19* string.c (coderange_scan): don't call mbclen functions for ASCIIakr
characters with ASCII compatible encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18* string.c (rb_str_dump): preserve the encoding of source stringmatz
if it is ASCII compatible. otherwise, add '.force_encoding()' for ugly work around. maybe we should implement some other way to keep non ASCII encoding in dumped string. [ruby-dev:33142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11* string.c (string.c): call rb_str_buf_append to update encoding ofakr
str1, even if str2 is empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11* string.c (rb_str_append): performance improvement.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11update rdoc: force_encoding doesn't accept nil.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-09* string.c (rb_enc_cr_str_buf_cat): fix self appending.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-09* string.c (rb_enc_cr_str_buf_cat, rb_str_buf_append): deal with selfnobu
appending. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-09* string.c (rb_enc_cr_str_buf_cat): do not recalculate coderangematz
value if it's given from outside. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-08* string.c (str_gsub): avoid appending empty pre-match substr.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* string.c (rb_str_buf_append): fix append itself.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* string.c (STR_ENC_GET): defined. same as rb_enc_get withoutakr
enc_capable. (coderange_scan): ASCII-8BIT test refined. (rb_enc_cr_str_buf_cat): new internal function to accumulate strings with encoding. (rb_enc_str_buf_cat): use rb_enc_cr_str_buf_cat. (rb_str_buf_append): ditto (str_gsub): use rb_str_buf_append. (rb_str_hash): use ENCODING_GET. (rb_str_comparable): ditto. (rb_str_cmp): compare encoding index, not rb_encoding address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* string.c (Init_String): sym_match arity spec was wrong. a patchmatz
from Hiroyuki Iwatsuki <don at na.rim.or.jp> in [ruby-dev:32957]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* string.c (str_gsub): move rb_enc_get(str) to out of loop.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* encoding.c (rb_enc_internal_get_index): extracted fromakr
rb_enc_get_index. (rb_enc_internal_set_index): extracted from rb_enc_associate_index * include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX. (ENCODING_GET): ditto. (ENCODING_IS_ASCII8BIT): defined. (ENCODING_CODERANGE_SET): defined. * re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT. * string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT. * parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT. * marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* string.c (coderange_scan): avoid rb_enc_to_index.akr
(rb_enc_str_buf_cat): ditto. (str_cat_char): use rb_enc_str_buf_cat. (rb_str_inspect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e