ruby-changes:2617
From: ko1@a...
Date: 5 Dec 2007 15:26:16 +0900
Subject: [ruby-changes:2617] nobu - Ruby:r14108 (trunk): * parse.y (rb_intern3): fix to changing encoding to default, and
nobu 2007-12-05 15:25:56 +0900 (Wed, 05 Dec 2007) New Revision: 14108 Modified files: trunk/ChangeLog trunk/parse.y Log: * parse.y (rb_intern3): fix to changing encoding to default, and uncommented r13835, which is rare but not impossible. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=14108&r2=14107 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14108&r2=14107 Index: ChangeLog =================================================================== --- ChangeLog (revision 14107) +++ ChangeLog (revision 14108) @@ -1,3 +1,8 @@ +Wed Dec 5 15:25:55 2007 Nobuyoshi Nakada <nobu@r...> + + * parse.y (rb_intern3): fix to changing encoding to default, and + uncommented r13835, which is rare but not impossible. + Wed Dec 5 15:15:21 2007 Nobuyoshi Nakada <nobu@r...> * range.c (step_i, range_step): support non-fixnum steps. Index: parse.y =================================================================== --- parse.y (revision 14107) +++ parse.y (revision 14108) @@ -8876,31 +8876,19 @@ } } if (m - name < len) id = ID_JUNK; - /* - * davidflanagan: commented out because this just doesn't make sense. - * - * If we were called with a non-ascii encoding, then change - * the encoding to ASCII, unless the symbol had multi-byte characters - * and there are trailing non-identifier characters that are - * outside of ASCII. But all multi-byte characters - * are identifier chars, so there will never be trailing characters - * so this clause always changes the encoding of the string. - * - * The upshot is that the symbol is placed in the hashtable with - * an ASCII encoding, but is queried (at the top of this function) - * with its real encoding. So :x == :x is false when x is a - * multi-byte character. - * - if (enc != rb_enc_from_index(0)) { + if (enc != rb_default_encoding()) { + /* + * this clause makes sense only when called from other than + * rb_intern_str() taking care of code-range. + */ if (!mb) { for (; m <= name + len; ++m) { if (!ISASCII(*m)) goto mbstr; } + enc = rb_default_encoding(); } - enc = rb_enc_from_index(0); mbstr:; } - */ new_id: id |= ++global_symbols.last_id << ID_SCOPE_SHIFT; id_register: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml