Граф коммитов

210 Коммитов

Автор SHA1 Сообщение Дата
mame f2400eca0b * include/ruby/ruby.h, vm_core.h: add a type rb_blockptr.
* vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives
  blockptr and passes it to iterating block.

* proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives
  blockptr.  "rb_proc_call(self, args, blockptr)" in C corresponds to
  "self.call(*args, &block)" in Ruby.

* proc.c (proc_call): pass blockptr to block that is written in C.

* proc.c (curry): receive blockptr and pass it to original proc.
  [ruby-core:15551]

* vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc.

* thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for
  change of rb_proc_call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 15:52:51 +00:00
nobu 5a647a3f5f * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 09:25:32 +00:00
nobu 6cdc89332e * vm_core.h (struct rb_vm_struct): moved ruby_debug, ruby_verbose, and
rb_progname.

* ruby.c (rb_argv0): no longer used.

* vm.c: getters/setters for ruby_{debug,verbose}.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 05:18:03 +00:00
nobu 10bfa5d49f * include/ruby/intern.h (Init_stack): make to call ruby_init_stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 00:54:23 +00:00
usa 6d5e291f7d * include/ruby/win32.h: include ws2tcpip.h. fixed [ruby-Bugs-20528]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 07:43:45 +00:00
nobu 7c5e3348f7 * suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
nobu 075530a685 * suppress warnings with -Wwrite-string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
nobu 1a192e2b29 * include/ruby/mvm.h: new header file for MVM, and moved rb_vm_t and
rb_thread_t from vm_core.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 06:17:45 +00:00
nobu 7981720812 * include/ruby/ruby.h: renamed include guard.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 05:55:34 +00:00
ko1 a45cd8a01c * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h,
vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const".



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 16:19:14 +00:00
usa 477c0db2bd * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,
vm.c: need to add const to prototypes, of course.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 06:22:41 +00:00
naruse fe8bb86125 * encoding.c, include/ruby/encoding.h
(rb_enc_associate, rb_enc_associate_index):
  returns obj. [ruby-dev:34778]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 22:26:14 +00:00
naruse 13f20ccda7 * encoding.c (rb_ascii8bit_encoding): use ENCINDEX_ASCII.
* encoding.c, include/ruby/encoding.h (rb_ascii8bit_encindex):
  added.

* encoding.c (rb_locale_encoding): use rb_usascii_encoding().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 19:21:26 +00:00
naruse 95698ff2a4 * transcode.c, include/ruby/encodng.h (rb_str_transcode):
C API of encoding conversion for Ruby object.
  VALUE rb_str_transcode(VALUE str, VALUE to).

* transcode.c (str_encode, str_encode_bang):
  rename from rb_tr_transcode or rb_str_transcode_bang.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 16:37:13 +00:00
nobu 0343750b62 * include/ruby/ruby.h (PRI[diouxX]VALUE): printf format for VALUE.
* gc.c (assign_heap_slot): suppress a warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-20 02:36:09 +00:00
matz 44cd8e457b * regparse.c (PINC): use optimized enclen() instead of
ONIGENC_MBC_ENC_LEN().

* regparse.c (PFETCH): ditto.

* regparse.c (PFETCH): small optimization.

* regexec.c (slow_search): single byte encoding optimization.

* regenc.h (enclen): avoid calling function when encoding's
  min_len == max_len.

* re.c (rb_reg_regsub): rb_enc_ascget() optimization for single
  byte encoding.

* re.c (rb_reg_search): avoid allocating new re_registers if we
  already have MatchData.

* re.c (match_init_copy): avoid unnecessary onig_region_free()
  before onig_region_copy. 

* encoding.c (rb_enc_get_index): remove implicit enc_capable check
  each time.

* encoding.c (rb_enc_set_index): ditto.

* encoding.c (enc_compatible_p): small refactoring.

* include/ruby/encoding.h (rb_enc_dummy_p): inline
  rb_enc_dummy_p() and export related code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 08:25:03 +00:00
ko1 385f0e8af6 * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.
VM value stack frame of block contains cref information.
  (dfp[-1] points CREF)
* compile.c, eval_intern.h, eval_method.c, load.c, proc.c,
  vm_dump.h, vm_core.h: ditto.
* include/ruby/ruby.h, gc.c: remove T_VALUES because of above
  changes.
* bootstraptest/test_eval.rb, test_knownbug.rb: move solved test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 03:08:50 +00:00
nobu 22361a3d1c * file.c (file_expand_path): support for alternative data stream
and ignored trailing garbages of NTFS.

* file.c (rb_file_s_basename): ditto.

* file.c (rb_file_s_extname): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-15 06:34:02 +00:00
usa 9416fedc28 * process.c, include/ruby/intern.h (rb_run_exec_options): externed.
* process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2,
	  run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options):
	  save parent's process environments.
	  !!!remark!!! these are not thread-safe.

	* process.c (rb_spawn_internal): remove calling run_exec_options()
	  because cannot restore after spawn. we'll fix this later.

	* io.c (pipe_open): ditto.

	* test/ruby/test_process.rb (test_execopts_env): upcase environment
	  variable name for case insensitive platforms.

	* win32/win32.c (init_env): set USER environment variable only when
	  USERNAME is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 14:15:32 +00:00
akr 6c1e664bb1 * bignum.c (bigzero_p): check from MSB to LSB. [ruby-dev:34649]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 04:44:13 +00:00
akr e389ce0676 * include/ruby/ruby.h (SIZET2NUM): new macro.
(NUM2SIZET): new macro.

* gc.c (struct rb_objspace): use size_t for increment, length and
  used for 64bit.
  (allocate_heaps): ditto.
  (assign_heap_slot): ditto.
  (set_heaps_increment): ditto.
  (gc_mark_all): ditto.
  (is_pointer_to_heap): ditto.
  (free_unused_heaps): ditto.
  (gc_sweep): ditto.
  (os_obj_of): ditto.
  (rb_gc_call_finalizer_at_exit): ditto.
  (count_objects): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-11 05:44:36 +00:00
akr 14a97fd48a * thread.c (thread_cleanup_func_before_exec): extracted from
thread_cleanup_func not to touch pthread data.
  pthread_cond_destroy in forked process may cause deadlock on
  Debian GNU/Linux Etch on x86, x86-64 and IA64.
  this doesn't cause resource leak because the process will exec soon.
  (terminate_atfork_before_exec_i): defined.
  (rb_thread_atfork_before_exec): defined.

* include/ruby/intern.h (rb_thread_atfork_before_exec): declared.

* process.c (rb_exec_atfork): call rb_thread_atfork_before_exec
  instead of rb_thread_atfork.

* io.c (popen_exec): call rb_thread_atfork_before_exec instead of
  rb_thread_atfork.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-11 04:15:29 +00:00
akr 36cb003300 * process.c (check_exec_redirect_fd): prohibit duplex IO.
(check_exec_fds): record maxhint even if close_others is not
  specified.
  (rb_exec_arg_fixup): renamed from rb_exec_arg_fix.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-30 05:40:19 +00:00
akr 6daf556345 * include/ruby/ruby.h (POSFIXABLE): use FIXNUM_MAX+1 instead of
FIXNUM_MAX to make it possible to convert to double accurately.
  It assumes FLT_RADIX is 2.
  fix RubyForge bug #14102.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28 05:25:03 +00:00
akr 59ba2bf0b6 * include/ruby/intern.h (rb_exec_arg_init): declared.
(rb_exec_arg_addopt): delared.
  (rb_exec_arg_fix): declared.
  (rb_exec_initarg): removed.
  (rb_exec_getargs): removed.
  (rb_exec_initarg2): removed.

* io.c (struct popen_arg): make execarg as a pointer.
  (popen_exec): follow popen_arg change.
  (pipe_open): add eargp argument.  extract argc and argv from eargp.
  use rb_exec_arg_addopt to add redirect options.
  (pipe_open_v): set up struct rb_exec_arg.
  (pipe_open_s): set up struct rb_exec_arg.

* process.c (rb_exec_arg_addopt): new function extracted from
  check_exec_options_i.
  (check_exec_options_i): use rb_exec_arg_addopt.
  (rb_check_exec_options): opthash is always a hash now.
  (rb_exec_getargs): make it static.
  (rb_exec_fillarg): renamed from rb_exec_initarg2.  don't set up
  redirect_fds.
  (rb_exec_arg_init): new function.
  (rb_exec_arg_fix): new function.
  (rb_f_exec): use rb_exec_arg_init and rb_exec_arg_fix.  use
  rb_exec_arg_addopt to set close_others option.
  (run_exec_options): make close_others by default.
  (rb_spawn_internal): use rb_exec_arg_init and rb_exec_arg_fix.  use
  rb_exec_arg_addopt to set close_others option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28 00:11:46 +00:00
akr 514715250a * include/ruby/intern.h (rb_hash_dup): declared.
* hash.c (rb_hash_dup): new function.

* process.c (rb_spawn_internal): don't modify option hash.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 12:52:25 +00:00
nobu 87e4ad0a23 * io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 09:36:35 +00:00
ko1 9d0a5d8e96 * include/ruby/ruby.h, gc.c: remove T_BLOCK.
* include/ruby/ruby.h: re-number T_xxx.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 08:32:23 +00:00
usa 62da750abe * include/ruby/win32.h: define mode_t for umask.
* process.c (check_exec_options_i, check_exec_fds, run_exec_options):
	  support "close_others" only when fork(2) is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-25 01:55:22 +00:00
akr 278b63a3e4 * include/ruby/intern.h (rb_env_clear): declared.
(rb_io_mode_modenum): declared.
  (rb_close_before_exec): declared.
  (struct rb_exec_arg): add options and redirect_fds field.
  (rb_check_argv): removed.
  (rb_exec_initarg): declared.
  (rb_exec_getargs): declared.
  (rb_exec_initarg2): declared.
  (rb_fork): add third argument: fds.

* io.c (max_file_descriptor): new static variable to record maximum
  file descriptor ruby used.
  (UPDATE_MAXFD): new macro.
  (UPDATE_MAXFD_PIPE): new macro.
  (rb_io_mode_modenum): externed.
  (rb_sysopen): update max_file_descriptor.
  (rb_close_before_exec): new function.
  (popen_exec): redirection removed because it is done by extended
  spawn mechanism.
  (pipe_open): generate a hash for spawn options to specify
  redirections.
  (pipe_open_v): use rb_exec_getargs.
  (pipe_open_s): use rb_exec_getargs.
  (rb_io_initialize): update max_file_descriptor..

* process.c (hide_obj): new function.
  (check_exec_redirect_fd): new function.
  (check_exec_redirect): new function.
  (check_exec_options_i): new function.
  (check_exec_fds): new function.
  (rb_check_exec_options): new function.
  (check_exec_env_i): new function.
  (rb_check_exec_env): new function.
  (rb_exec_getargs): new function.
  (rb_exec_initarg2): new function.
  (rb_exec_initarg): new function.
  (rb_f_exec): use rb_exec_initarg.
  (intcmp): new function.
  (run_exec_dup2): new function.
  (run_exec_close): new function.
  (run_exec_open): new function.
  (run_exec_pgroup): new function.
  (run_exec_rlimit): new function.
  (run_exec_options): new function.
  (rb_exec): call run_exec_options.
  (move_fds_to_avoid_crash): new function.
  (pipe_nocrash): new function.
  (rb_fork): use pipe_nocrash to avoid file descriptor conflicts.
  (rb_spawn): use rb_exec_initarg.
  (rlimit_resource_name2int): extracted from rlimit_resource_type.
  (rlimit_type_by_hname): new function.
  (rlimit_type_by_lname): new function.
  (rlimit_resource_type): use rlimit_type_by_hname.
  (proc_daemon): add fds argument for rb_fork.

* hash.c (rb_env_clear): renamed from env_clear and externed.

[ruby-dev:34086]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-24 14:46:39 +00:00
knu d657d4feb3 * enumerator.c, include/ruby/ruby.h: Export rb_cEnumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20 12:01:27 +00:00
nobu 639c3a8962 * include/ruby/intern.h (rb_argv): replaced with rb_get_argv().
[ruby-Bugs-19514]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 09:02:19 +00:00
nobu 1ea2f2a492 * include/ruby/intern.h (rb_argv): removed. [ ruby-Bugs-19514 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 08:55:17 +00:00
nobu b2dde8243b * gc.c (Init_stack): use ruby_init_stack. [ruby-dev:34350]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 03:52:27 +00:00
nobu 7b4a171158 * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.

* gc.c (source_filenames): removed.

* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
  ripper_initialize): rb_source_filename() is no longer used.

* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
  parser_warn, e_option_supplied, warn_unless_e_option, range_op,
  cond0): nd_file is no longer used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 03:41:51 +00:00
matz a4d6f2265a * include/ruby/node.h: add new constants for rb_call()'s scope.
* eval.c (iterate_method): use CALL_* scope constant to specify
  proper scope value.

* eval.c (rb_each, rb_apply, rb_funcall, rb_funcall2, rb_funcall3):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-01 21:30:36 +00:00
naruse e58adeae0f * re.c (rb_memsearch_ss): simple shift search.
* re.c (rb_memsearch_qs): quick search.

* re.c (rb_memsearch_qs_utf8): quick search for UTF-8 string.

* re.c (rb_memsearch_qs_utf8_hash): hash functions for above.

* re.c (rb_memsearch): use above functions.

* string.c (rb_str_index): give enc to rb_memsearch.

* include/ruby/intern.h (rb_memsearch): move to encoding.h.

* include/ruby/encoding.h (rb_memsearch): move from intern.h.

* common.mk (PREP): add dependency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-17 19:04:29 +00:00
tadf 6125552c27 both complex and rational are now builtin classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 00:23:43 +00:00
nobu 657429b75b * include/ruby/ruby.h (inttypes.h): includes always if available.
* string.c, ext/digest/defs.h: moved inttypes.h to ruby.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 08:04:45 +00:00
akr be36a1b138 * include/ruby/missing.h (cbrt): add declaration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 05:06:30 +00:00
nobu c015c6fa8e * include/ruby/encoding.h (rb_str_coderange_scan_restartable): added
prototype.

* string.c (rb_str_coderange_scan_restartable, rb_str_times): removed
  unsed variables.

* string.c (rb_enc_str_copy): unused now.  may be used in future?


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28 02:13:51 +00:00
akr b58e36da4a * include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.
(ROBJECT_IVPTR): renamed from ROBJECT_PTR.

* variable.c: follow the above renaming.

* object.c: ditto.

* gc.c: ditto.

* marshal.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-25 16:18:18 +00:00
nobu 552badf29f * debug.c (ruby_set_debug_option): separated ruby_each_words().
* util.c (ruby_each_words): extracted from ruby_set_debug_option().

* ruby.c (proc_options): generalized enable/disable options.

* ruby.c (ruby_init_gems): take enabled flag.  [ruby-core:14840]

* ruby.c (process_options): added --disable-rubyopt flag.

* include/ruby/util.h (ruby_each_words): prototype.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23 21:13:05 +00:00
naruse bad85e5202 * follow type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-23 11:21:02 +00:00
naruse 4701476b97 * include/ruby/encoding.h (rb_enc_asciicompat): dummy encoding is not
ascii compatible. [ruby-dev:33878]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-21 01:36:50 +00:00
nobu 99b9eaaa68 * win32/win32.c (rb_w32_map_errno): exported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-20 14:55:21 +00:00
matz 588d870234 * include/ruby/node.h (NODE_FL_NEWLINE): renamed from NODE_NEWLINE
to denote its a flag.  [ruby-core:15529]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-18 05:33:01 +00:00
naruse 8dd8dfce21 * encoding.c (ENC_CODERANGE_AND): fix broken case. [ruby-dev:33826]
* string.c (rb_str_times): fix broken case. [ruby-dev:33826]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-17 13:01:52 +00:00
naruse 7a257b0110 * encoding.c (ENC_CODERANGE_AND): added.
* string.c (rb_str_plus, srb_str_times): keep coderange.

* parse.y (STR_NEW0) use rb_usascii_str_new.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-17 06:49:11 +00:00
akr 71c5e48598 * include/ruby/re.h (struct rmatch_offset): new struct for character
offsets.
  (struct rmatch): new struct.
  (struct RMatch): reference struct rmatch.
  (RMATCH_REGS): new macro.

* re.c (match_alloc): initialize struct rmatch.
  (pair_byte_cmp): new function.
  (update_char_offset): update character offsets.
  (match_init_copy): copy regexp and character offsets.
  (match_sublen): removed.
  (match_offset): use update_char_offset.
  (match_begin): ditto.
  (match_end): ditto.
  (rb_reg_search): make character offset updated flag false.
  (match_size): use RMATCH_REGS.
  (match_backref_number): ditto.
  (rb_reg_nth_defined): ditto.
  (rb_reg_nth_match): ditto.
  (rb_reg_match_pre): ditto.
  (rb_reg_match_post): ditto.
  (rb_reg_match_last): ditto.
  (match_array): ditto.
  (match_aref): ditto.
  (match_values_at): ditto.
  (match_inspect): ditto.

* string.c (rb_str_subpat_set): use RMATCH_REGS.
  (rb_str_sub_bang): ditto.
  (str_gsub): ditto.
  (rb_str_split_m): ditto.
  (scan_once): ditto.

* gc.c (obj_free): free character offsets.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-16 20:08:35 +00:00