ruby-changes:3720
From: ko1@a...
Date: Thu, 24 Jan 2008 16:26:05 +0900 (JST)
Subject: [ruby-changes:3720] usa - Ruby:r15209 (trunk): * parse.y (reg_fragment_setenc_gen): recognize regexp with option n as
usa 2008-01-24 16:25:46 +0900 (Thu, 24 Jan 2008) New Revision: 15209 Modified files: trunk/ChangeLog trunk/parse.y Log: * parse.y (reg_fragment_setenc_gen): recognize regexp with option n as as ASCII-8BIT instead of US-ASCII. [ruby-dev:33339] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15209&r2=15208&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15209&r2=15208&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15208) +++ ChangeLog (revision 15209) @@ -1,3 +1,8 @@ +Thu Jan 24 16:24:25 2008 NAKAMURA Usaku <usa@r...> + + * parse.y (reg_fragment_setenc_gen): recognize regexp with option n as + as ASCII-8BIT instead of US-ASCII. [ruby-dev:33339] + Thu Jan 24 15:44:42 2008 Yukihiro Matsumoto <matz@r...> * array.c (collect_bang_i): use rb_ary_store() to avoid potential Index: parse.y =================================================================== --- parse.y (revision 15208) +++ parse.y (revision 15209) @@ -456,6 +456,7 @@ #define RE_OPTION_ENCODING_SHIFT 8 #define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT) #define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff) +#define RE_OPTION_ENCODING_NONE(o) ((o)&32) #define RE_OPTION_MASK 0xff #define NODE_STRTERM NODE_ZARRAY /* nothing to gc */ @@ -8478,6 +8479,9 @@ } ENCODING_SET(str, idx); } + else if (RE_OPTION_ENCODING_NONE(options)) { + rb_enc_associate(str, rb_ascii8bit_encoding()); + } } static void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/