1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (assignable_gen): ignore already erred names.

* parse.y (shadowing_lvar_gen): always make new block local variable
  when shadowing outer local variable.  [ruby-dev:31507]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-08-30 18:49:00 +00:00
parent 70f5d818f8
commit 7aaf7dac8d
5 changed files with 21 additions and 15 deletions

View file

@ -1,3 +1,10 @@
Fri Aug 31 03:48:58 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (assignable_gen): ignore already erred names.
* parse.y (shadowing_lvar_gen): always make new block local variable
when shadowing outer local variable. [ruby-dev:31507]
Thu Aug 30 19:40:33 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* regenc.h: check RUBY_EXTERN before including config.h and defines.h

View file

@ -3,16 +3,7 @@
# So all tests will cause failure.
#
# massign
assert_equal 'ok', %q{
def m()
yield :ng
end
r = :ok
m {|(r)|}
r
}, '[ruby-dev:31507]'
# catch/throw
assert_equal 'ok', %q{
begin
catch {|t| throw t, :ok }

View file

@ -13,6 +13,12 @@ assert_equal '[1, 2]', %q{
ans
}
assert_equal 'ok', %q{
r = :ok
:ng.tap {|(r)|}
r
}, '[ruby-dev:31507]'
=begin
# generated by this script:

View file

@ -1023,7 +1023,7 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
| primary_value '[' opt_call_args rbracket tOP_ASGN command_call
{
/*%%%*/
NODE *args = $3;
NODE *args;
value_expr($6);
if (!$3) $3 = NEW_ZARRAY();
@ -6677,7 +6677,7 @@ parser_yylex(struct parser_params *parser)
tokadd(c);
c = nextc();
if (parser_is_identchar()) {
tokadd(c);
tokadd(c);
}
else {
pushback(c);
@ -7253,6 +7253,7 @@ gettable_gen(struct parser_params *parser, ID id)
static NODE*
assignable_gen(struct parser_params *parser, ID id, NODE *val)
{
if (!id) return 0;
if (id == keyword_self) {
yyerror("Can't change the value of self");
}
@ -7321,6 +7322,7 @@ shadowing_lvar_gen(struct parser_params *parser, ID name)
}
else if (dvar_defined(name) || local_id(name)) {
rb_warningS("shadowing outer local variable - %s", rb_id2name(name));
vtable_add(lvtbl->vars, name);
}
}
else {

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-08-30"
#define RUBY_RELEASE_DATE "2007-08-31"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070830
#define RUBY_RELEASE_CODE 20070831
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8
#define RUBY_RELEASE_DAY 30
#define RUBY_RELEASE_DAY 31
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];