diff --git a/ChangeLog b/ChangeLog index 9223cdf61a..0e4522b331 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 22 14:30:34 2007 Nobuyoshi Nakada + + * parse.y (reg_named_capture_assign_iter): allows non-ascii names and + get rid of reserved word IDs. + Sat Dec 22 14:18:45 2007 Koichi Sasada * test/ruby/test_float.rb, test_sprintf.rb: fix test place. diff --git a/parse.y b/parse.y index 4a81ae7af0..7b64c237a7 100644 --- a/parse.y +++ b/parse.y @@ -8516,8 +8516,8 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end, arg->fail_block = NEW_BEGIN(0); } - if (!(len && rb_enc_islower(*name, enc) && rb_enc_symname2_p(s, len, enc)) - || rb_reserved_word(name, len)) { + if (!len || (*name != '_' && ISASCII(*name) && !rb_enc_islower(*name, enc)) || + rb_reserved_word(s, len) || !rb_enc_symname2_p(s, len, enc)) { return ST_CONTINUE; } var = rb_intern3(s, len, enc);