ruby-changes:3712
From: ko1@a...
Date: Thu, 24 Jan 2008 07:36:50 +0900 (JST)
Subject: [ruby-changes:3712] naruse - Ruby:r15201 (trunk): * parse.y (STR_NEW0): set encoding as US-ASCII.
naruse 2008-01-24 07:35:27 +0900 (Thu, 24 Jan 2008) New Revision: 15201 Modified files: trunk/ChangeLog trunk/parse.y Log: * parse.y (STR_NEW0): set encoding as US-ASCII. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15201&r2=15200&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15201&r2=15200&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15200) +++ ChangeLog (revision 15201) @@ -1,3 +1,7 @@ +Thu Jan 24 07:34:34 2008 NARUSE, Yui <naruse@r...> + + * parse.y (STR_NEW0): set encoding as US-ASCII. + Thu Jan 24 03:47:41 2008 NARUSE, Yui <naruse@r...> * lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb, Index: parse.y =================================================================== --- parse.y (revision 15200) +++ parse.y (revision 15201) @@ -268,7 +268,7 @@ #define UTF8_ENC() (parser->utf8 ? parser->utf8 : \ (parser->utf8 = rb_utf8_encoding())) #define STR_NEW(p,n) rb_enc_str_new((p),(n),parser->enc) -#define STR_NEW0() rb_str_new(0,0) +#define STR_NEW0() rb_enc_str_new(0,0,rb_usascii_encoding()) #define STR_NEW2(p) rb_enc_str_new((p),strlen(p),parser->enc) #define STR_NEW3(p,n,e,func) parser_str_new((p),(n),(e),(func)) #define STR_ENC(m) ((m)?parser->enc:rb_enc_from_index(0)) @@ -4667,7 +4667,7 @@ if (!compile_for_eval && rb_safe_level() == 0) { ruby_debug_lines = debug_lines(ruby_sourcefile); if (ruby_debug_lines && ruby_sourceline > 0) { - VALUE str = rb_str_new(0, 0); + VALUE str = STR_NEW0(); n = ruby_sourceline; do { rb_ary_push(ruby_debug_lines, str); @@ -7446,7 +7446,7 @@ htype = nd_type(head); if (htype == NODE_EVSTR) { - NODE *node = NEW_DSTR(rb_str_new(0, 0)); + NODE *node = NEW_DSTR(STR_NEW0()); head = list_append(node, head); } switch (nd_type(tail)) { @@ -7489,7 +7489,7 @@ evstr2dstr_gen(struct parser_params *parser, NODE *node) { if (nd_type(node) == NODE_EVSTR) { - node = list_append(NEW_DSTR(rb_str_new(0, 0)), node); + node = list_append(NEW_DSTR(STR_NEW0()), node); } return node; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/