Prohibit assignment to numbered parameters.
It is stricter than CRuby but confusing anyway.
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -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

Prohibit assignment to numbered parameters.

It is stricter than CRuby but confusing anyway.