* parse.y (reg_named_capture_assign_iter): captured name should
not be reserved word. a patch from Keita Yamaguchi <keita.yamaguchi AT gmail.com> in [ruby-dev:32675]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0fe66f38cc
commit
c6b8f89c2e
@ -1,3 +1,9 @@
|
|||||||
|
Sat Dec 22 10:25:44 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (reg_named_capture_assign_iter): captured name should
|
||||||
|
not be reserved word. a patch from Keita Yamaguchi
|
||||||
|
<keita.yamaguchi AT gmail.com> in [ruby-dev:32675].
|
||||||
|
|
||||||
Sat Dec 22 10:19:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Dec 22 10:19:08 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_f_method_name): now __method__ and __callee__ are
|
* eval.c (rb_f_method_name): now __method__ and __callee__ are
|
||||||
|
3
parse.y
3
parse.y
@ -8516,7 +8516,8 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
|
|||||||
arg->fail_block = NEW_BEGIN(0);
|
arg->fail_block = NEW_BEGIN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(len && rb_enc_islower(*name, enc) && rb_enc_symname2_p(s, len, enc))) {
|
if (!(len && rb_enc_islower(*name, enc) && rb_enc_symname2_p(s, len, enc))
|
||||||
|
|| rb_reserved_word(name, len)) {
|
||||||
compile_error(PARSER_ARG "named capture with a non local variable - %.*s",
|
compile_error(PARSER_ARG "named capture with a non local variable - %.*s",
|
||||||
len, name);
|
len, name);
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user