diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-12-26 19:27:14 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-12-27 11:05:56 +0900 |
| commit | d15e56dab03f2295dd1d9ecc2e22c6f0ce53e0e3 (patch) | |
| tree | 3d5951e1186bef2e132673f5c1253d243573e71c /mrbgems/mruby-compiler | |
| parent | ff16331754cd63c54279592fe4be77991bb6327d (diff) | |
| download | mruby-d15e56dab03f2295dd1d9ecc2e22c6f0ce53e0e3.tar.gz mruby-d15e56dab03f2295dd1d9ecc2e22c6f0ce53e0e3.zip | |
Prohibit assignment to numbered parameters.
It is stricter than CRuby but confusing anyway.
Diffstat (limited to 'mrbgems/mruby-compiler')
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 45c6229da..f8db486a5 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/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 |
