nobu
2d1d6c4705
* encoding.c (rb_enc_from_encoding, rb_enc_register): associate index
...
to self.
* encoding.c (enc_capable): Encoding objects are encoding capable.
* re.c (rb_reg_s_union): check if encoding matching by exact encoding
objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-17 02:30:57 +00:00
nobu
5daecbc0e1
* encoding.c (rb_enc_alias, rb_enc_find_index): changed
...
enc_table_alias to a name-to-index hash.
* encoding.c (rb_enc_init): use upper case names for aliases to use as
constant names.
* encoding.c (enc_find): allow symbols.
* encoding.c (Init_Encoding): define encoding constants.
* st.c (strcasehash): fix wrong code range condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 21:18:09 +00:00
nobu
de46b903a9
* encoding.c (enc_list): seems a commit miss.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 20:26:29 +00:00
nobu
3cd040b6ef
* encoding.c (rb_primary_encoding): added Encoding.primary_encoding.
...
* 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
2007-10-16 20:07:20 +00:00
nobu
b06a606278
* re.c (rb_reg_desc): set encoding.
...
* re.c (rb_reg_s_union): check encodings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 18:37:09 +00:00
nobu
59609a4fba
* enc/utf8.c (utf8_code_to_mbclen): 0xfe and 0xff are valid Unicode to
...
be encoded to 2bytes in UTF-8. [ruby-core:12700]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 18:06:31 +00:00
nobu
b1d53d10e2
* string.c (rb_str_ord): use encoding.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 17:50:51 +00:00
nobu
81ed881511
* re.c (rb_reg_initialize_m): allow binary encoding option.
...
[ruby-dev:32083]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 16:57:08 +00:00
akr
24c863cf84
It should be ArgumentError that
...
Regexp.union(
"a",
Regexp.new("\x80".force_encoding("euc-jp")),
Regexp.new("\x80".force_encoding("utf-8"))).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 11:06:27 +00:00
nobu
5d8ba5a43f
* re.c (rb_reg_s_union): check for encoding of original object.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 10:48:02 +00:00
akr
55eed62a43
Regexp.union("a", "a") causes SEGV.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 09:47:31 +00:00
akr
6ade565b63
NODE_LMASK is also possible for enum.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 09:39:04 +00:00
akr
dfcfa13872
* debug.c: use enum for constants for gdb if possible.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 09:29:32 +00:00
akr
4b3a26c00e
* ruby.c, debug.c: move debug enum and constants to debug.c.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 09:21:11 +00:00
akr
b8dc3c1e2a
* ruby.c (RUBY_ENCODING_SHIFT): added as enum.
...
* .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
2007-10-16 09:17:28 +00:00
nobu
676dc908b6
* parse.y (parser_regx_options): check if regexp encoding option
...
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
2007-10-16 05:48:40 +00:00
matz
9f00119776
* re.c (rb_reg_s_union): encoding of all regexp objects should
...
match. [ruby-dev:32076]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 05:06:30 +00:00
matz
4ad19a7dee
* encoding.c (enc_to_s): rename function.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 04:50:16 +00:00
nobu
eb6e9c15bd
* string.c (rb_str_new4): should copy encoding. a patch from NARUSE,
...
Yui <naruse AT airemix.com>. [ruby-dev:32076]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16 04:25:47 +00:00
matz
8cb190c416
* enum.c (enum_inject): RDoc update. a patch from David Flanagan
...
<david AT davidflanagan.com> in [ruby-core:12679]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 16:41:30 +00:00
matz
ff3859899d
* encoding.c (Init_Encoding): define #to_s to show encoding name
...
in to_s representation as well as #inspect.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 16:28:18 +00:00
nobu
118625a3b3
* numeric.c (flo_round): should be number but not rounding factor.
...
[ruby-dev:32060]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 04:24:10 +00:00
nobu
16652ad4ce
* marshal.c (r_bytes0): refined length check. [ruby-dev:32059]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 02:45:14 +00:00
akr
8c3658fd1b
* process.c (pst_to_s): returns a string such as "pid 10220 exit 1"
...
instead of "256". [ruby-dev:32053]
(pst_inspect): change format
"#<Process::Status: pid=10220,exited(1)>" to
"#<Process::Status: pid 10220 exit 1>".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 01:31:11 +00:00
nobu
cb1d63724c
* bootstraptest/test_knownbug.rb: a test for [ruby-dev:32054] moved to test/ruby/test_marshal.rb now.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 01:11:52 +00:00
nobu
d420686fdc
* marshal.c (r_bytes0): commit miss.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 01:06:51 +00:00
nobu
14264f5f62
* marshal.c (r_bytes0): check if source has enough data.
...
[ruby-dev:32054]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-15 00:58:09 +00:00
akr
297d2e05cb
* ext/socket/socket.c (s_accept_nonblock): make accepted fd
...
nonblocking. [ruby-talk:274079]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 16:18:41 +00:00
akr
a0e3752870
add a test for [ruby-dev:32054].
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 15:36:24 +00:00
nobu
b314d3e999
* encoding.c (rb_obj_encoding): rdoc update. a patch from David
...
Flanagan <david AT davidflanagan.com>. [ruby-core:12664]
* encoding.c (enc_dump, enc_load): marshaling feature. a patch from
David Flanagan. [ruby-core:12665]
* encoding.c (Init_Encoding): undefine allocator of Encoding.
[ruby-core:12665], [ruby-core:12666]
* test/ruby/test_encoding.rb: tests for Encoding from David Flanagan
[ruby-core:12665]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 08:31:51 +00:00
akr
9d326d261e
* lib/pp.rb (PP::PPMethods#pp_hash): don't sort keys because hash is
...
ordered.
(ENV.pretty_print): call pp_hash with sorted hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 02:14:16 +00:00
nobu
b933a5348b
* configure.in (AC_SYS_LARGEFILE): keep results also in command
...
options, to vail out of mismatch. [ruby-list:44114]
* mkconfig.rb, lib/mkmf.rb (configuration): add DEFS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 19:08:37 +00:00
nobu
5542fe44bd
* win32/mkexports.rb: deal with __fastcall name decorations.
...
[ruby-list:44111]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 18:55:54 +00:00
nobu
c7f7510259
* inits.c (rb_call_inits): call Init_Encoding.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 17:20:42 +00:00
nobu
9c24fed339
* encoding.c (rb_cEncoding): new Encoding class.
...
* encoding.c (rb_to_encoding, rb_to_encoding_index): helper functions.
* encoding.c (rb_obj_encoding): return Encoding object now.
* gc.c (garbage_collect): mark Encoding objects.
* string.c (rb_str_force_encoding): accept Encoding object as well as
encoding name.
* include/ruby/encoding.h (rb_to_encoding_index, rb_to_encoding):
prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 16:32:40 +00:00
akr
04c290820c
* lib/open-uri.rb (OpenURI.open_http): fix :ssl_ca_cert option.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 16:04:31 +00:00
suke
31c764ff7f
* ext/win32ole/win32ole.c (foletype_s_ole_classes,
...
foletype_s_typelibs): refactoring.
* test/win32ole/test_win32ole_type.rb: add some test.
* ext/win32ole/win32ole.c (Init_win32ole): change method name
WIN32OLE_TYPELIB.ole_types from WIN32OLE_TYPELIB.ole_classes.
* test/win32ole/test_win32ole_typelib.rb: ditto.
* test/win32ole/test_folderitem2_invokeverb.rb: check create
shortcut string more strictly (This test is invoked in Japanese
Windows environment).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 12:40:24 +00:00
nobu
e0a6ff2aa6
* parse.y (set_file_encoding): case-insensitive search, a patch from
...
David Flanagan <david AT davidflanagan.com> [ruby-core:12629]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 00:12:00 +00:00
nobu
fc3e0bd562
* {bcc,win}32/mkexports.rb: explicit data. [ruby-list:44108]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 00:02:20 +00:00
matz
9f99bc4631
* lib/rexml/document.rb (REXML::Document::write): leaky
...
modification trans -> transitive. [ruby-dev:32040]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12 15:19:28 +00:00
matz
d962ef7454
* parse.y: encoding specifier should work if the line matches
...
/coding[:=] ?/, a la Python PEP-263, so that VIM comments like
"# vim: set fileencoding=<encoding name>" should be recognized.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12 15:04:46 +00:00
matz
ba9eb2c929
* re.c (match_values_at): make #select to be alias to #values_at
...
to adapt RDoc description. [ruby-core:12588]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12 14:35:26 +00:00
matz
7927f32a19
* array.c (rb_ary_combination): fixed memory corruption due to too
...
small memory allocation
* array.c (rb_ary_product): accessing out of memory bounds.
condition fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12 14:34:37 +00:00
nobu
b1e97c9070
* trunk/parse.y (magic_comments): add "encoding" as same as "coding".
...
* trunk/parse.y (set_file_encoding): special file encoding handling.
* trunk/parse.y (parser_yylex): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12 06:04:57 +00:00
matz
9bcbd08b0b
* include/ruby/node.h (NOEX_LOCAL): remove unused local visibility.
...
* class.c (ins_methods_push): ditto.
* class.c (rb_class_local_methods): method removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-11 13:20:14 +00:00
usa
ba997e3529
* bcc32/Makefile.sub, too.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-11 05:31:48 +00:00
usa
46a30fd4a2
* win32/Makefile.sub (COMMON_MACROS): workaround for old SDK's bug.
...
[ruby-core:12584]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-11 05:30:21 +00:00
nobu
72483cdcca
* Makefile.in, */Makefile.sub (VPATH): add enc directory.
...
* common.mk (ENCOBJS): encoding objects.
* enc: directory for encodings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-10 21:35:45 +00:00
matz
5fc7312d1b
* include/ruby/oniguruma.h (OnigEncodingTypeST): add OnigEncoding
...
parameter to every function members.
* include/ruby/oniguruma.h (OnigEncodingTypeST): add auxiliary
data member to provide user defined data for an encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-10 15:05:32 +00:00
matz
79a202433c
* re.c (rb_reg_s_quote): no longer takes optional second argument
...
that has never been documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-10 14:34:42 +00:00