mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 38039: [Backport #7408]
* parse.y (parser_yylex): fix false usage of local variable, it cannot appear in fname state [ruby-core:49659] [Bug #7408] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
59995abc1e
commit
f19478d5e3
4 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Dec 19 21:15:29 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_yylex): fix false usage of local variable, it cannot
|
||||
appear in fname state [ruby-core:49659] [Bug #7408]
|
||||
|
||||
Wed Dec 19 21:14:28 2012 Narihiro Nakamura <authornari@gmail.com>
|
||||
|
||||
* gc.c: return true or false. Patch by Dirkjan Bussink. [Bug #6821]
|
||||
|
|
3
parse.y
3
parse.y
|
@ -7923,7 +7923,8 @@ parser_yylex(struct parser_params *parser)
|
|||
ID ident = TOK_INTERN(!ENC_SINGLE(mb));
|
||||
|
||||
set_yylval_name(ident);
|
||||
if (last_state != EXPR_DOT && is_local_id(ident) && lvar_defined(ident)) {
|
||||
if (last_state != EXPR_DOT && last_state != EXPR_FNAME &&
|
||||
is_local_id(ident) && lvar_defined(ident)) {
|
||||
lex_state = EXPR_END;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -489,6 +489,8 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
assert_in_out_err(["-we", "1.times do\n a=1\nend"], "", [], [], feature3446)
|
||||
assert_in_out_err(["-we", "def foo\n 1.times do\n a=1\n end\nend"], "", [], ["-e:3: warning: assigned but unused variable - a"], feature3446)
|
||||
assert_in_out_err(["-we", "def foo\n"" 1.times do |a| end\n""end"], "", [], [])
|
||||
bug7408 = '[ruby-core:49659]'
|
||||
assert_in_out_err(["-we", "def foo\n a=1\n :a\nend"], "", [], ["-e:2: warning: assigned but unused variable - a"], bug7408)
|
||||
end
|
||||
|
||||
def test_shadowing_variable
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.3"
|
||||
#define RUBY_PATCHLEVEL 343
|
||||
#define RUBY_PATCHLEVEL 344
|
||||
|
||||
#define RUBY_RELEASE_DATE "2012-12-19"
|
||||
#define RUBY_RELEASE_YEAR 2012
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue