aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
Commit message (Collapse)AuthorAgeFilesLines
* RUBY_DEVEL flagnobu2017-06-211-0/+2
| | | | | | | | | | | * configure.in: define RUBY_DEVEL only in the trunk. * gc.c: enable runtime rgengc debug if RUBY_DEVEL * ruby.c (debug_option): enable RUBY_DEBUG in --debug option only if RUBY_DEVEL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: debug options in command linenobu2017-06-211-0/+4
| | | | | | | * ruby.c (debug_option): parse options in --debug command line option same as RUBY_DEBUG env. available only in the trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: script name in UTF-8nobu2017-06-081-6/+9
| | | | | | | * ruby.c (process_options): keep script name in UTF-8 if UTF8_PATH to get rid of loss by conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: dladdr_path is not used on cygwinnobu2017-06-031-1/+1
| | | | | | | * ruby.c (dladdr_path): dladdr is provided on recent cygwin, but GetModuleFileNameW is used instead of it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* improve English for a warning messageduerst2017-06-011-1/+1
| | | | | | | | On DOSish systems, there is a warning message for \r\n line endings on shebang line. Improve this message from "shebang line ends with \r may cause a problem" to "shebang line ending with \r may cause problems". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: file in load_file argumentnobu2017-05-281-14/+14
| | | | | | | * ruby.c (load_file): move opened file to an argument, to reduce open/close calls in the near future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: shrink ruby_cmdline_options_tnobu2017-05-281-9/+11
| | | | | | | | * ruby.c (ruby_cmdline_options_t): reordered members and turned simple flags into bit fields to reduce the size (136->104 on LP64). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: encode script namenobu2017-05-171-8/+10
| | | | | | | * ruby.c (process_options): encode script name to locale encoding instead of associate, if UTF-8 path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: defining DATAnobu2017-01-311-20/+18
| | | | | | | * ruby.c (load_file_internal): define DATA here instead of ensure func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: forbid optionsnobu2017-01-311-8/+6
| | | | | | | | * ruby.c (forbid_setid): constified. * ruby.c (process_options): forbid if setid earlier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* declare `rb_w32_sysinit` in header.usa2016-12-131-1/+0
| | | | | | | | | | * include/ruby/win32.h (rb_w32_sysinit): declare. [ruby-core:78444] [Bug #12994] * ruby.c (ruby_sysinit): follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: dump optionnobu2016-12-071-9/+19
| | | | | | | * ruby.c (process_options): dump specified informations all, not only first one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: retry loading with GCnobu2016-10-211-1/+7
| | | | | | | * ruby.c (open_load_file): retry after GC when the limit for open file descriptors reached. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (open_load_file): revert r56385. it introduced incompatibilityusa2016-10-121-9/+6
| | | | | | | about `DATA.binmode?`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix macrosnobu2016-10-121-2/+2
| | | | | | | * ruby.c (open_load_file): FILE_ALT_SEPARATOR and EXEEXT are config.status variables, not available in config.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: bind fd before waitingnobu2016-10-101-13/+11
| | | | | | | * ruby.c (open_load_file): bind the open fd to an IO instance before waiting FIFO, not to leak the fd if interrupted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: compare with EXEEXTnobu2016-10-101-3/+7
| | | | | | | * ruby.c (open_load_file): compare with EXEEXT instead of hard coded name, and do not match with mere EXEEXT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: open in binary mode to loadnobu2016-10-101-6/+9
| | | | | | | * ruby.c (open_load_file): open in binary mode if available, as parser deals with EOLs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_cmdline_options_tnobu2016-08-191-18/+20
| | | | | | * ruby.c (ruby_cmdline_options_t): typedef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_funcallvnobu2016-07-291-1/+1
| | | | | | | * *.c: rename rb_funcall2 to rb_funcallv, except for extensions which are/will be/may be gems. [Fix GH-1406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: revisit the structure of frame, block and env.ko12016-07-281-7/+4
| | | | | | | | | | | | | | | | | | | | | | [Bug #12628] This patch introduce many changes. * Introduce concept of "Block Handler (BH)" to represent passed blocks. * move rb_control_frame_t::flag to ep[0] (as a special local variable). This flags represents not only frame type, but also env flags such as escaped. * rename `rb_block_t` to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects wb-protected. Check [Bug #12628] for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: refix r55260nobu2016-06-031-1/+3
| | | | | | | | | * ruby.c (process_options): rb_str_conv_enc() never set encoding of the source string, but returns the string itself if the conversion failed. then the instance variable does not need to be set again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): need to duplicate path before passing it tousa2016-06-031-1/+1
| | | | | | | | rb_str_conv_enc() because the function might call rb_enc_associate() internally. this fixes test failures on Windows introduced at r55260. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: no MAXPATHLEN for loadpathnobu2016-06-021-6/+35
| | | | | | | * ruby.c (ruby_init_loadpath_safe): remove MAXPATHLEN restriction for Windows 10. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix -e script encodingnobu2016-04-261-2/+19
| | | | | | | | * ruby.c (process_options): convert -e script to the encoding given by a command line option on Windows. assume it is the expected encoding. [ruby-dev:49461] [Bug #11900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r54742nobu2016-04-241-13/+3
| | | | | | Commit miss. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix compile error other than gccnobu2016-04-241-3/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix command line encoding on cygwinnobu2016-04-231-0/+2
| | | | | | | * ruby.c: cygwin does not use w32_cmdvector, command line can be other than UTF-8. [ruby-dev:49519] [Bug #12184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove rb_thread_t::parse_in_evalnobu2016-03-281-31/+19
| | | | | | | | | | | | * parse.y (struct parser_params): move parse_in_eval flag from rb_thread_t. * parse.y (rb_parser_set_context): set parsing context, not only mild error flag. * iseq.c (rb_iseq_compile_with_option): the parser now refers no thread local states to be restored. * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SyntaxError message at iseq compilenobu2016-03-191-0/+8
| | | | | | | | | | | | * iseq.c (rb_iseq_compile_with_option): make the parser in mild error. * load.c (rb_load_internal0): ditto. * parse.y (yycompile0): return the error message within the error to be raised. [Feature #11951] * parse.y (parser_compile_error): accumulate error messages in the error_buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: reduce fstatnobu2016-03-141-11/+4
| | | | | | | | | * file.c (ruby_is_fd_loadable): now return -1 if loadable but may block. * ruby.c (open_load_file): wait to read by the result of ruby_is_fd_loadable, without fstat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r54082 "ruby.c: load in binary mode"nobu2016-03-111-5/+2
| | | | | | | DATA is expected to be text mode, but there is no ways to make a FD to text mode from binary mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: load in binary modenobu2016-03-111-2/+5
| | | | | | | * ruby.c (open_load_file): always open in binary mode if provided, parser deals with CRs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: extra commanobu2016-03-081-20/+32
| | | | | | | * ruby.c (feature_option, debug_option, dump_option): remove an extra comma from option lists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rubyoptions.rb: fix testnobu2016-03-071-4/+2
| | | | | | | | * test/ruby/test_rubyoptions.rb (test_shebang): adjust only expected stderr as a warning, assertion has meaning on all platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (warn_cr_in_shebang): meaningless check on DOSISH platforms.usa2016-03-071-0/+6
| | | | | | | fixed a test failure introduced at r53998. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: warn_cr_in_shebangnobu2016-03-041-0/+10
| | | | | | | * ruby.c (load_file_internal): warn if shebang line ends with a carriage return. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: simplifynobu2016-03-041-9/+10
| | | | | | | * ruby.c (load_file_internal): simplify by local variables instead of repeating RSTRING macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: remove a magic numbernobu2016-03-041-1/+1
| | | | | | | | | | * ruby.c (load_file_internal): remove a magic number, which means the length of ruby_engine but the value is unknown in this file since the variable is in a different file now. instead, strstr should deal with it well, as far as ruby_engine does not contain a space and a hyphen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse without $.nobu2016-02-241-4/+1
| | | | | | | | | | | | * io.c (rb_io_gets_internal): read one line from an IO without setting ARGF.lineno. * parse.y (lex_io_gets): use rb_io_gets_internal not to affect $. global variable. * ruby.c (load_file): no longer reset $. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: remove unnecessary contextnobu2016-02-221-6/+2
| | | | | | | | * ruby.c (process_options): remove unnecessary context. rb_parser_append_print and rb_parser_while_loop just append some nodes and do not depend on the context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fixup r53791nobu2016-02-091-1/+0
| | | | | | | * ruby.c (DEFAULT_FEATURES): debug features are no longer set since r53791. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (dump_option): fix a typo.kazu2016-02-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: available list from enumnobu2016-02-091-2/+8
| | | | | | | * ruby.c (feature_option, debug_option, dump_option): build available list in warning messages from enum lists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_DUMPSnobu2016-02-091-18/+14
| | | | | | * ruby.c (EACH_DUMPS): define the list of dumping feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: set feature bits onlynobu2016-02-091-1/+3
| | | | | | | * ruby.c (DEFAULT_FEATURES): set feature bits only, excluding debug features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_DEBUG_FEATURESnobu2016-02-091-3/+7
| | | | | | | * ruby.c (EACH_DEBUG_FEATURES): define the list of debug feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename ADD_FEATUREnobu2016-02-091-2/+3
| | | | | | | * ruby.c (ADD_FEATURE_NAME): rename ADD_FEATURE, as it does not add a feature, but just append a name to the message string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: err ambiguous feature name [ci skip]nobu2016-02-081-0/+22
| | | | | | | * ruby.c (feature_option): raise a runtime error if ambiguous feature name is given, in the future. [Bug #12050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: EACH_FEATURESnobu2016-02-071-8/+9
| | | | | | * ruby.c (EACH_FEATURES): define the list of feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e