aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-14 11:11:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-14 11:11:45 +0000
commit2de3281af4050913ae2c8e47f47c0cdb422a48d1 (patch)
tree0106aca75e5f825679200138f20325b2f33694b7 /parse.y
parentdb4e9d5eb331cfbb5c9d9a1abbb87955ae63a99b (diff)
downloadruby-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.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 924ec57260..20345085b5 100644
--- a/parse.y
+++ b/parse.y
@@ -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
{