aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
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