Prohibit assignment to numbered parameters.

It is stricter than CRuby but confusing anyway.
parent ff163317
...@@ -1952,6 +1952,10 @@ lhs : variable ...@@ -1952,6 +1952,10 @@ lhs : variable
backref_error(p, $1); backref_error(p, $1);
$$ = 0; $$ = 0;
} }
| tNUMPARAM
{
yyerror(p, "can't assign to numbered parameter");
}
; ;
cname : tIDENTIFIER cname : tIDENTIFIER
...@@ -3275,6 +3279,10 @@ var_lhs : variable ...@@ -3275,6 +3279,10 @@ var_lhs : variable
{ {
assignable(p, $1); assignable(p, $1);
} }
| tNUMPARAM
{
yyerror(p, "can't assign to numbered parameter");
}
; ;
var_ref : variable var_ref : variable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment