summaryrefslogtreecommitdiff
path: root/range.c
AgeCommit message (Collapse)Author
2009-07-17* range.c (recursive_hash): extracted from range_hash. rejectakr
recursive key. (range_hash): use recursive_hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16* bignum.c (rb_big_new, rb_bigzero_p), range.c (rb_range_values):nobu
added for random.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01* hash.c (rb_hash_hash): documentation fix. a patch frommatz
Marc-Andre Lafortune. [ruby-core:23943] * object.c (rb_mod_cmp): ditto. * range.c (range_eq): ditto. * string.c (rb_str_partition, rb_str_rpartition): ditto. * struct.c (rb_struct_s_def): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-07* range.c (r_le): fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-07* range.c (range_eql): fixed rdoc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* range.c (range_each): check #succ only when it is reallymatz
needed. small performance improvement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14* string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame
include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04* range.c (range_step): should not add up errors on loops.matz
[ruby-dev:37691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04* range.c (range_max): max value from ... not defined for nonmatz
Integer Numeric end values. [ruby-dev:37690] fix: #974 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04* numeric.c (ruby_float_step): extracted from num_step().nobu
* range.c (range_step): uses ruby_float_step() for float range. [ruby-dev:37691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-03* range.c (rb_range_beg_len): rb_raise takes C values as arguments.yugui
[BUG] ranges turned into other value in a message of RangeError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-25* range.c (range_inspect): fix SEGV for cyclic range object.mame
[ruby-core:18835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20* range.c (range_initialize_copy): Range is now a Struct.nobu
[ruby-core:18353] * struct.c (rb_struct_init_copy): made public. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02* range.c (range_step): call to_int if step is not a numericmatz
value. [ruby-dev:34575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02* range.c (range_step): do not forcefully convert steps intomatz
integers. [ruby-dev:34571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02* range.c (range_step): step may be bignum.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01* range.c (range_step): check if step can be converted to an integer.nobu
[ruby-dev:34558] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01* range.c (range_step): allow float step bigger than zero but lessnobu
than one. [ruby-dev:34557] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28* range.c (range_each): use INT2FIX() for fixnum values.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-07* range.c (range_each_func): should not leave a variablenobu
uninitialized, which could cause SEGV. * range.c (range_step): removed duplicated and unreachable code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-06* bignum.c (rb_cmpint): moved from compar.c, to check bignummatz
zero. * range.c (range_step): add step for each iteration if begin and end are numeric. [ruby-core:15990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03* range.c (range_include): add RDoc to describe that comparisonmatz
for numeric is done according magnitude of values. [ruby-core:15907] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15* range.c (rb_range_beg_len): check if responds to "begin" and "end"nobu
methods for non-Range object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15490 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-01-29* range.c: fix SEGV by ("a" .. "z").step(2 ** 30) { }.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05* range.c (step_i, range_step): support non-fixnum steps.nobu
[ruby-talk:282100] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* insns.def (concatarray, splatarray): use to_a instead ofmatz
to_splat. * insnhelper.ci (caller_setup_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-23* struct.c (rb_struct_alloc_noinit): new function.akr
(rb_struct_define_without_accessor): add allocator to the arguments. * range.c (range_alloc): re-introduced using rb_struct_alloc_noinit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-23* struct.c (rb_struct_define_without_accessor): new function.akr
* range.c (range_alloc): removed. (Init_Range): use rb_struct_define_without_accessor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-19* range.c (range_last): commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-18* range.c (Init_Range): typo fixed.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-18* range.c (range_first): takes first n element if argument ismatz
given. [ruby-core:12697] * range.c (range_last): returns last n elements if argument is given. * array.c (rb_ary_subseq, rb_ary_last): export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-10* range.c (range_dumper): make uninitialized range dumpable.akr
(range_loader): make uninitialized range loadable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-10* range.c: represent initialized state using EXCL instead of FL_USER3.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-09* range.c (range_step): fixed integer overflow. [ruby-dev:31763]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08* eval_method.ci (rb_get_alloc_func): new function to get allocationakr
function. * include/ruby/intern.h (rb_alloc_func_t): declared. (rb_define_alloc_func): declared. (rb_marshal_define_compat): declared. * range.c: use T_STRUCT for Range. * inits.c: move Init_marshal() prior to Init_Range() because Init_Range calls rb_marshal_define_compat which needs marshal's compat_allocator_tbl initialized. * marshal.c: support marshal format compatibility layer designed for marshaling T_STRUCT Range using T_OBJECT format. (rb_marshal_define_compat): defined. [ruby-dev:31710] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* encoding.c: provide basic features for M17N.matz
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-26* range.c (range_eqq): call_super() in === does not work wellmatz
since Enumerable#=== has different behavior. [ruby-dev:31296] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13* range.c (range_max, range_min): return nil for empty set as well asnobu
1.8 and Enumerable. [ruby-dev:31198] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12* range.c (range_max): use FIX2LONG instead of FIX2INT to avoidakr
RangeError by ((-0x80000001)...(-0x80000001)).max on LP64. * insns.def (opt_plus): use FIX2LONG instead of FIX2INT to avoid RangeError by 0x3fffffffffffffff+1 on LP64. * insns.def (opt_succ): don't use 0x80000000 which assumes 32bit VALUE. use FIX2LONG instead of FIX2INT. [ruby-dev:31190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-22* string.c (rb_str_upto): add optional argument to specifymatz
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
2007-06-10* include/ruby: moved public headers.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,nobu
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c, insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y, range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: fixed indents and non-C90 comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 * Merge YARVko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-02* eval.c (splat_value): use "to_splat" instead of "to_ary" tomatz
prepare splat values as an array. * array.c (Init_Array): define to_splat. * range.c (range_to_splat): new method. * enumerator.c (enumerator_to_splat): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e