summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-24 15:28:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-24 15:28:14 +0000
commitbe7c04e1971f84d104b74a02f4cdc22ec2c14b7a (patch)
tree309515a456efa87bb581249bad97cca6acd04881 /parse.y
parent418c46f2844b2385cc38bb37f2538d18f04abd08 (diff)
parse.y: dynamic const assign_error in ripper
* parse.y (mlhs_node): dynamic constant assignment in massign should cause assign_error, like as single assign and backref assignment in massign. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 34ff12d405..882a282137 100644
--- a/parse.y
+++ b/parse.y
@@ -1672,9 +1672,10 @@ mlhs_node : user_variable
yyerror("dynamic constant assignment");
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
/*%
- if (in_def || in_single)
- yyerror("dynamic constant assignment");
$$ = dispatch2(const_path_field, $1, $3);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
%*/
}
| tCOLON3 tCONSTANT
@@ -1685,6 +1686,9 @@ mlhs_node : user_variable
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
/*%
$$ = dispatch1(top_const_field, $2);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
%*/
}
| backref