Prohibit assignment to numbered parameters.

It is stricter than CRuby but confusing anyway.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-12-26 19:27:14 +09:00
parent ff16331754
commit d15e56dab0
+8
View File
@@ -1952,6 +1952,10 @@ lhs : variable
backref_error(p, $1);
$$ = 0;
}
| tNUMPARAM
{
yyerror(p, "can't assign to numbered parameter");
}
;
cname : tIDENTIFIER
@@ -3275,6 +3279,10 @@ var_lhs : variable
{
assignable(p, $1);
}
| tNUMPARAM
{
yyerror(p, "can't assign to numbered parameter");
}
;
var_ref : variable