aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
Commit message (Collapse)AuthorAgeFilesLines
* * encoding.c (rb_ascii_encoding): renamed from previousmatz2007-12-211-2/+2
| | | | | | rb_default_encoding(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_register): set encoding constant.nobu2007-12-211-4/+8
| | | | | | | | | | | * encoding.c (rb_enc_find_index): replace non-alphanumeric chars with underscores, so that initialize function can be called. * ruby.c (proc_options, process_options): finds encoding after load_path is initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix previous locale_encoding change.akr2007-12-211-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_charmap): return nil if no locale information.akr2007-12-211-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: include locale.hakr2007-12-211-26/+8
| | | | | | | | | | | | | | (rb_locale_charmap): new method Encoding.locale_charmap for nl_langinfo(CODESET). * include/ruby/encoding.h (rb_locale_charmap): declared. * main.c (main): call setlocale with LC_CTYPE. * ruby.c (locale_encoding): use rb_locale_charmap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,akr2007-12-211-1/+1
| | | | | | | | | | | compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c, ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb, ext/openssl/ossl_bn.c, numeric.c, vm.c, benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal" for non law violation context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c, regerror.c, string.c, parse.y, ruby.c, file.c:akr2007-12-121-1/+1
| | | | | | | | use capital letter for \xHH notation. [ruby-dev:32511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_expr_str): use \xHH instead of \OOO.akr2007-12-091-1/+1
| | | | | | | | | | | | | | | | | | * regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): make rb_raise format as a string literal to akr2007-12-081-6/+6
| | | | | | | avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): reverted c flag.nobu2007-12-041-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: rename primary_encoding -> default_external (encoding).matz2007-12-011-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (usage): fix typo on --disable-gems option.akr2007-11-151-1/+1
| | | | | | | pointed by Richard Kilmer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (parse.c), ext/ripper/depend (ripper.c): process afternobu2007-11-131-3/+5
| | | | | | | | | | | | | | | | | | | | | bison with sed. [ruby-dev:32204] * ruby.c (proc_options): use yydebug in cmdline_options. * ruby.c (process_options): set yydebug flag of parser. * parse.y (yydebug): moved into struct parser_params. * parse.y (rb_parser_get_yydebug, rb_parser_set_yydebug): parser generic methods. * */Makefile.sub (parse.c): moved to common.mk. * tool/ytab.sed: comment out yydebug definition, and substitute yyerror with parser_yyerror. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gem_prelude.rb: new file for gem libraries. currently empty.akr2007-11-101-0/+16
| | | | | | | | | | | | | | | | | * common.mk: generate ext_prelude.c by prelude.rb and gem_prelude.rb. ruby (not miniruby) is linked with ext_prelude.o instead of prelude.o. * inits.c (rb_call_inits): don't call Init_prelude. * ruby.c: support --disable-gems option. (ruby_init_gems): new function to define Gem::Enable and invoke Init_prelude. (process_options): call ruby_init_gems just after ruby_init_loadpath. * tool/compile_prelude.rb: support multiple files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (locale_encoding): guestimate encoding from environmentnobu2007-11-091-4/+35
| | | | | | | | | variables. [ruby-core:13315] * ruby.c (process_options): set primary encoding from environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (set_arg0): fix breaking environ bugs.ko12007-11-091-6/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: --with-vendordir implemented.akr2007-11-031-0/+7
| | | | | | | | | | | * mkconfig.rb: add config to vendorlibdir and vendorarchdir. * instruby.rb: make vendor library directories. * ruby.c: insert vendor library directories into load path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): encoding set by command line option takesnobu2007-10-231-1/+8
| | | | | | | priority over the encoding in the source, as the primary encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): allow space after -E (encoding) option.matz2007-10-221-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): set primary encoding from the parsernobu2007-10-191-9/+1
| | | | | | | | | always. [ruby-core:12758] * ruby.c (load_file): should not discard the parser parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): fixed reversed condition. [ruby-core:12722]nobu2007-10-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_primary_encoding): added Encoding.primary_encoding.nobu2007-10-161-6/+35
| | | | | | | | | | | | | | | | | * parse.y (rb_parser_encoding): added. * ruby.c (proc_options): added -E and --encoding options. * ruby.c (process_options): set primary encoding from command line option if set, or source encoding. * include/ruby/encoding.h (rb_enc_from_encoding, rb_get_primary_encoding, rb_set_primary_encoding): prototypes. * include/ruby/node.h (rb_parser_encoding): prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c, debug.c: move debug enum and constants to debug.c.akr2007-10-161-46/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (RUBY_ENCODING_SHIFT): added as enum.akr2007-10-161-0/+3
| | | | | | | | * .gdbinit (rp): show encoding and coderange for strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_regx_options): check if regexp encoding optionnobu2007-10-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matches to current encoding. * re.c (char_to_option, rb_char_to_option_kcode): 'n' is not kcode option now. * re.c (rb_reg_to_s, rb_reg_error_desc): copy encoding rather than append as an option. * re.c (make_regexp, rb_reg_prepare_re): use encoding of Regexp and String instead of kcode. * re.c (rb_reg_initialize): set fixed option if none is set. * re.c (rb_reg_regcomp): ditto. * re.c (rb_reg_equal): check if encodings are equal. * re.c (rb_reg_initialize_m): encoding option is obsolete. * re.c (rb_kcode, rb_get_kcode, rb_set_kcode): removed. * re.c (Init_Regexp): removed Regexp#kcode method. * ruby.c (proc_options): allow long encoding name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h: make node flags as VALUE type.akr2007-10-071-1/+6
| | | | | | | | | enum ruby_node_flags removed. * ruby.c: define RUBY_NODE_* as const for gdb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: enum ruby_value_flags removed.akr2007-10-071-1/+30
| | | | | | | * ruby.c: define RUBY_FL_* as const VALUE for gdb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (ruby_process_options): push frame with program name.nobu2007-10-031-10/+20
| | | | | | | [ruby-core:12351] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (require_libraries): use require method instead of callingnobu2007-10-011-5/+4
| | | | | | | rb_require directly. [ruby-dev:31322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_options), ruby.c (proc_options, process_options): notnobu2007-10-011-5/+5
| | | | | | | | | call exit(2) directly. [ruby-dev:31912] * eval.c (ruby_run_node): deal with direct exit code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * main.c (main): use platform-independent per-process initialization.nobu2007-09-291-5/+37
| | | | | | | | | | | | | | | | [ruby-dev:31900] * ruby.c (ruby_sysinit): new function for per-process initialization. * include/ruby/ruby.h (RUBY_GLOBAL_SETUP): toplevel setup declaration. * include/ruby/win32.h, win32/mkexports.rb: alias NtInitialize ruby_sysinit. * win32/win32.c (rb_w32_sysinit): renamed from NtInitialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (origarg): commit miss.nobu2007-09-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (struct cmdline_options): static variables packed.nobu2007-09-281-183/+199
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fdopen): create IO object from fd.nobu2007-09-281-21/+46
| | | | | | | | | * parse.y (yycompile): use encoding of the source as default. * ruby.c (proc_options, load_file): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_initialize): set default encoding. [ruby-dev:31787]nobu2007-09-151-7/+10
| | | | | | | | * ruby.c (load_file): make new parse instance after processing shebang line options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): -W should be allowed in RUBYOPTmatz2007-09-121-1/+1
| | | | | | environment variable. [ruby-core:12118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: provide basic features for M17N.matz2007-08-251-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * dln.c (load_1, dln_find_1): constified.nobu2007-07-261-2/+2
| | | | | | | * ruby.c (usage): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c (conv_to_posix_path): removed.nobu2007-07-261-92/+109
| | | | | | | | | | | | | * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): return VALUE instead of a pointer to static buffer. * ruby.c (push_include_cygwin): fixed buffer overflow. [ruby-dev:31297] * ruby.c (ruby_init_loadpath): not convert built-in paths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_parser_append_print, rb_parser_while_loop): moved checknobu2007-07-181-2/+2
| | | | | | | | | | for node to the head. * ruby.c (proc_options): do nothing for -p/-n options if tree is null. submitted by Yusuke ENDOH <mame AT tsg.ne.jp> at [ruby-dev:31243]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c: Qfalse is VALUE, not pointer.usa2007-07-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): moved do_print and do_loop optionsnobu2007-07-051-9/+9
| | | | | | | handling from ruby_process_options(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,nobu2007-07-051-53/+27
| | | | | | | | | eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c, yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline, ruby_nerrs): purge global variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{node,ruby}.h, ruby.c: added enum constants for gdbnobu2007-07-051-0/+9
| | | | | | | | | support. [ruby-dev:31066] * .gdbinit: some improvements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: remove ruby_current_node and change eval() prototype.ko12007-06-241-5/+0
| | | | | | | | | | | fix to use rb_sourcefile/line() instead of ruby_sourcefile/line. * error.c, eval_error.ci, eval_load.c, eval_safe.ci, gc.c, include/ruby/intern.h, parse.y, process.c, ruby.c: ditto. * vm.c: fix spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_*.h: rename to eval_*.ci.ko12007-06-241-2/+0
| | | | | | | | | | | * common.mk: ditto. * eval_error.ci: remove ruby_set_current_source(). * error.c, eval.c, ruby.c: ditto. * eval_safe.c, proc.c: remove unused macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (set_arg0): support RSTRING_LEN on HP-UX. a patch frommatz2007-05-221-10/+10
| | | | | | WATANABE Tetsuya <Tetsuya.WATANABE AT nifty.com>. [ruby-dev:30806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (DllMain, ruby_init_loadpath): use DLL instance handle givennobu2007-05-181-9/+13
| | | | | | | | to DllMain instead of VirtualQuery so that loadpath becomes relative from the DLL on WinCE too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-118/+179
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e