diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-14 11:11:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-14 11:11:45 +0000 |
commit | 2de3281af4050913ae2c8e47f47c0cdb422a48d1 (patch) | |
tree | 0106aca75e5f825679200138f20325b2f33694b7 /parse.y | |
parent | db4e9d5eb331cfbb5c9d9a1abbb87955ae63a99b (diff) | |
download | ruby-2de3281af4050913ae2c8e47f47c0cdb422a48d1.tar.gz |
parse.y: warn reference after method definition
* parse.y (primary): restore current_arg so that circular
reference after a method definition is also warned.
[ruby-core:61299] [Bug #9593]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3027,12 +3027,15 @@ primary : literal %*/ local_pop(); in_def--; + current_arg = $<id>3; } | k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname { in_single++; lex_state = EXPR_ENDFN; /* force for args */ local_push(0); + $<id>$ = current_arg; + current_arg = 0; } f_arglist bodystmt @@ -3048,6 +3051,7 @@ primary : literal %*/ local_pop(); in_single--; + current_arg = $<id>6; } | keyword_break { |