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

291 Коммитов

Автор SHA1 Сообщение Дата
yugui 5c94b5d113 * eval.c (ruby_options): evaluator now expects iseq instead of tree.
* ruby.c (ruby_process_options): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 04:04:31 +00:00
nobu f35308b3ef * eval_intern.h (translit_char): moved from ruby.c.
* load.c (load_ext): transliterates file separators and back if
  needed.

* symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 06:11:41 +00:00
nobu 6d3ceb6ce3 * configure.in, */Makefile.sub (LOAD_RELATIVE): moved from ruby.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 05:48:14 +00:00
usa 03c7332241 * ruby.c (process_options): set initial default_external before -r.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 03:12:09 +00:00
usa 5067bfe36e * ruby.c (process_options): -K and -E in shebang should be reflect to
default_external. [ruby-dev:37920]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 03:05:27 +00:00
nobu f4e9d9a2c5 * configure.in (RUBY_LIB_VERSION): added for library version, to
split from core version.  [ruby-dev:37748]

* configure.in (RUBY_LIB_PATH, etc): moved actual version
  dependent stuff to version.c.

* ruby.c (ruby_init_loadpath_safe): ditto.

* version.c (ruby_initial_load_paths): moved initial load path
  version depending on version from ruby.c.

* version.h (RUBY_VERSION_{MAJOR,MINOR,TEENY}): now mean library
  and API version, and reverted to 1.9.1.  [ruby-dev:37889]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 02:21:37 +00:00
nobu 813dad7afd * ruby.c (load_file_internal): resets EOF flag after parse.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 14:37:09 +00:00
nobu 845103b751 * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),
eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c
  (uscore_get, rb_f_chop), st.c (stat_col), signal.c
  (rb_signal_buff_size, ruby_sig_finalize), thread.c
  (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone):
  protoized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 12:51:44 +00:00
nobu 938fcd6b70 * io.c (rb_io_ungetbyte, rb_io_ungetc): allows nil to reset EOF
flag with ungetting nothing.

* ruby.c (load_file_internal): rests EOF flag to make possible to
  load from stdin after reading data.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21 12:42:39 +00:00
nobu 1a0f593b3c * ruby.c (load_file_internal): no need to cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21 04:59:20 +00:00
ko1 d31e1d4a52 * ruby.c (require_libraries): reset th->parse_in_eval while
loading libraries.  fixes [ruby-dev:37780]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 04:41:19 +00:00
ko1 c4c3f238d7 * iseq.c:
rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn().
  rename ruby_iseq_disasm() -> rb_iseq_disasm().
* compile.c:
  rename ruby_iseq_compile() -> rb_iseq_compile_node().
  rename ruby_iseq_translate_threaded_code() ->
  rb_iseq_translate_threaded_code().
  rename ruby_insns_name_array() -> rb_insns_name_array().
  rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary().
* iseq.c, compile.c: remove ruby_insn_make_insn_table() and make
  static function insn_make_insn_table().
* iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c,
  blockinlining.c: ditto.
  Rename strange "ruby_" prefix to "rb_" prefix.
  This changes may affect only core because renamed functions
  require a pointer of rb_iseq_t which is not exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 01:06:56 +00:00
ko1 e40928733d * ruby.c (process_options): decrement parse_in_eval to recognize
parsing main or normal eval script.
* compile.c (rb_parse_in_main): return 1 if parsing main script.
  (if parse_in_eval is negative value, it means main script)
* parse.y (yycompile0): check rb_parse_in_main() to accumulate
  script text.  Bug #848 [ruby-core:20450]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 16:14:43 +00:00
matz c6af6b1b94 * symbian/README.SYMBIAN: symbian support added. great appreciate
to <alexandre.zavorine at symbian.com>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 01:53:08 +00:00
ko1 ec5283e691 * ruby.c (process_options): set th->base_block only while
it is needed.
* ruby.c (require_libraries): clear th->base_block before
  require libraries.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-28 18:45:24 +00:00
ko1 b19be9b1a9 * ruby.c (process_options): fix to untouch th->mild_compile_error.
[ruby-dev:37621], [ruby-dev:37620]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 06:05:41 +00:00
ko1 597220ef0c * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
  instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
  main script (specified by -e or script name) should be run
  under TOPLEVEL_BINDING using Kernel#eval.  Above changes
  simulate Kernel#eval behaviour.  [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
  this fix is needed for [ruby-dev:37240], and also fixes
  [ruby-dev:35392].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 01:15:56 +00:00
nobu e5bfdb8391 * ruby.c (process_options): get rid of warning on DOSISH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-19 06:51:52 +00:00
usa 6a613ba2e4 * ruby.c (set_arg0): use strlcpy() instead of strncpy().
* load.c (rb_feature_p): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 02:37:45 +00:00
matz 0e20782339 * ruby.c (process_options): revive global sub, gsub, chop, chomp
only when auto looping options (-p/-n) is specified.
  [ruby-core:20570]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 14:46:50 +00:00
nobu f403298449 * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): cannot use
locale encoding before load path is initialized

* ruby.c (ruby_init_loadpath_safe): ditto.

* ruby.c (process_options): loads encdb so that encodings can be
  loaded, then associates script name and load paths with the
  locale encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 02:32:21 +00:00
kouji e53990e4bd * ruby.c (process_options): fixed default_internal is nil.
(closes #862)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 06:58:58 +00:00
yugui aa06e69000 * encoding.c (enc_get_default_encoding): removed.
Generalizing rb_default_{external,internal}_encoding seems to be
  difficult. 
  default_external cannot be NULL even before detected. [ruby-dev:37390]

* encoding.c (rb_default_external_encoding): has its own
  implementation again.

* encoding.c (rb_default_internal_encoding): ditto.

* gem_prelude.rb: added notice.

* ruby.c (rubylib_mangled_path, rubylib_mangled_path2): uses locale
  encoding but not ASCII-8BIT.

* ruby.c (process_options): refers less to default_external.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12 05:25:39 +00:00
nobu 774f924db9 * ruby.c (proc_options): added version, copyright, usage, yydebug,
syntax to --dump option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 02:28:17 +00:00
nobu ba274d1f46 * ruby.c (proc_options): source-encoding option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 02:15:47 +00:00
nobu ecc83033ba * ruby.c (set_option_encoding_once): dry.
* ruby.c (proc_options): checks extra argument for -E/--encoding.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08 01:32:36 +00:00
matz b58ed03759 * ruby.c (usage): -W description updated. [ruby-core:19858]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21 18:34:03 +00:00
davidflanagan 2228f91851 ruby.c (set_internal_encoding_once): fix typo in error string
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 22:18:21 +00:00
nobu 04e94c6ec8 * ruby.c (process_options): delays setting safe level.
[ruby-dev:36997]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-30 23:16:16 +00:00
matz 86c50e3983 * ruby.c (load_file_internal): should not set script encoding to
ASCII-8BIT.

* ruby.c (load_file_internal): do not auto convert scripts even
  when default_internal is set.  [ruby-core:19579]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-30 09:17:49 +00:00
nobu 5cdd7f52cc * ruby.c (moreswitches): splits option string and passes arguments.
* ruby.c (proc_options): checks if allowed in RUBYOPT.

* ruby.c (process_options): allows long style options in RUBYOPT.

* ruby.c (load_file_internal): ditto in shebang.  [ruby-dev:36979]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-30 01:34:23 +00:00
nobu bc4bc3a80f * ruby.c (load_file_internal): use ASCII-8BIT to prevent conversion.
[ruby-core:19579]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 00:30:09 +00:00
nobu bd92ab89c0 * ruby.c (load_file_internal): cache common interned IDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 00:23:04 +00:00
nobu 0a20a506e1 * ruby.c (load_file): preserves $.. [ruby-dev:36937]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 06:58:28 +00:00
yugui 5106742893 * ruby.c (usage): updated the description of -E option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-25 02:18:53 +00:00
matz 3f0ec8887f * string.c (rb_external_str_new): a new function to convert from
external encoding to internal encoding.  if something went
  wrong, it returns a string with the external encoding.

* string.c (rb_external_str_new_with_enc): same as above besides
  you can specify the source encoding.

* ruby.c (ruby_set_argv): use rb_external_str_new()

* ruby.c (set_arg0, ruby_script): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-18 10:36:20 +00:00
matz 4709e330cf * ruby.c (proc_options): no warning when default_external already
set by -E.

* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt):
  put -K after -E to set script encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-16 22:21:09 +00:00
matz 40adf66644 * ruby.c (process_options): -U should be allowed in RUBYOPT
environment variable.  [ruby-dev:36720]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-15 07:48:34 +00:00
nobu 40c08c9ee6 * ruby.c (proc_options): -U can be followed by other options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14 05:11:20 +00:00
matz 339ceda4e8 * ruby.c (set_internal_encoding_once): check double contradicted
specification of the encoding from command line.

* ruby.c (set_external_encoding_once): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14 00:41:09 +00:00
matz 9ed35ae793 * ruby.c (proc_options): add -U command line option to specify
utf-8 as default_internal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12 23:03:17 +00:00
matz baeeebf474 * encoding.c (rb_default_internal_encoding): merged a patch from
Michael Selig <michael.selig at fs.com.au> in [ruby-core:18985].

* io.c (rb_io_ext_int_to_encs): ditto.

* ruby.c (proc_options): support default internal encoding in -E
  option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-07 17:39:44 +00:00
yugui e8ee99ff1a * dln.c: Ruby no longer supports VMS.
* error.c: ditto.

* eval.c: ditto.

* eval_intern.h: ditto.

* include/ruby/defines.h: ditto.

* include/ruby/ruby.h: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* vms/config.h: removed.

* vms/vms.h: ditto.

* vms/vmsruby_private.c: ditto.

* vms/vmsruby_private.h: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:57:06 +00:00
yugui a8c3540b32 * dln.c: Ruby no longer supports Windows CE.
* eval.c: ditto.

* include/ruby/defines.h: ditto.

* include/ruby/win32.h: ditto.

* ruby.c: ditto.

* strftime.c: ditto.

* win32/Makefile.sub: ditto.

* win32/win32.c: ditto.

* ext/tk/extconf.rb: ditto.

* lib/fileutils.rb: ditto.

* test/fileutils/test_fileutils.rb: ditto.

* wince/*: removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:48:20 +00:00
yugui 642e081879 * dln.c: Ruby no longer supports MacOS 9 or before.
* eval.c: ditto.

* eval_intern.h: ditto.

* ext/extmk.rb: ditto.

* ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.

* ext/tk/stubs.c: ditto.

* file.c: ditto.

* hash.c: ditto.

* include/ruby/defines.h: ditto.

* ruby.c: ditto.

* signal.c: ditto.

* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:42:00 +00:00
yugui ae7ea3332b * dln.c: Ruby no longer supports MS-DOS.
* ext/sdbm/_sdbm.c: ditto.

* ext/sdbm/sdbm.h: ditto.

* gc.c: ditto.

* hash.c: ditto.

* include/ruby/defines.h: ditto.

* include/ruby/util.h: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* strftime.c: ditto.

* util.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:33:22 +00:00
yugui 8dd118c0db * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
* djgpp/README.djgpp: ditto.

* djgpp/config.hin: ditto.

* djgpp/config.sed: ditto.

* djgpp/configure.bat: ditto.

* djgpp/mkver.sed: ditto.

* ext/Setup.dj: ditto.

* dln.c: removed djgpp supports.

* file.c: ditto.

* gc.c: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* signal.c: ditto.

* util.c: ditto.

* vm_core.h: ditto.

* lib/fileutils.rb: ditto.

* lib/mkmf.rb: ditto.

* ext/socket/socket.c: ditto.

* test/fileutils/test_fileutils.rb: ditto.

* test/ruby/test_env.rb: ditto.

* test/ruby/test_path.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:25:12 +00:00
yugui bbbd9c0b7b * x68/_dtos18.c: removed. Ruby no longer supports human68k.
* x68/_round.c: ditto.

* x68/fconvert.c: ditto.

* x68/select.c: ditto.

* ext/Setup.x68: ditto.

* missing/x68.c: ditto.

* dln.c (dln_find_exe_r): removed human68k supports.
  (dln_find_1): ditto.

* lib/mkmf.rb: ditto.

* ext/extmk.rb (Init_ext): ditto.

* ext/socket/socket.c (init_sock): ditto.

* gc.c (GC_MALLOC_LIMIT): ditto.
  (rb_setjmp, rb_jmpbuf): ditto.
  (mark_current_machine_context): ditto.

* include/ruby/defines.h (PATH_ENV): ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* test/ruby/test_env.rb: ditto.

* test/ruby/test_path.rb: ditto.

* LEGAL


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:12:13 +00:00
ko1 2e311f6bd5 * include/ruby/node.h, node.h: move node.h from include path.
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 19:52:31 +00:00
ko1 7f7834abf7 * include/ruby/node.h, vm_core.h: move definition of
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 07:49:45 +00:00