diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-02 18:23:01 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-02 18:24:48 +0900 |
| commit | 6ac26e44429313c6bb58015028c61468e391f700 (patch) | |
| tree | 77b3692e5bc3948232523c9e1e30a119a18adfe8 /mrbgems/mruby-compiler/core/parse.y | |
| parent | bd88870afb6e1da7000b8c2bdebdac4f85f15310 (diff) | |
| download | mruby-6ac26e44429313c6bb58015028c61468e391f700.tar.gz mruby-6ac26e44429313c6bb58015028c61468e391f700.zip | |
parse.y: support anonymous block argument introduced by Ruby3.1.
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
| -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 2a1017f24..76fcffa70 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -2603,6 +2603,10 @@ block_arg : tAMPER arg { $$ = new_block_arg(p, $2); } + | tAMPER + { + $$ = new_block_arg(p, 0); + } ; opt_block_arg : comma block_arg @@ -3944,6 +3948,10 @@ f_block_arg : blkarg_mark tIDENTIFIER { $$ = $2; } + | blkarg_mark + { + $$ = intern_op(and); + } ; opt_f_block_arg : ',' f_block_arg |
