diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-10 01:08:15 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-10 01:08:15 +0000 |
commit | 0e3b349f7a250e14c8c93b52507e557344bce800 (patch) | |
tree | 8edb1a59d129300539245135b80194271cf63870 /parse.y | |
parent | a707c831123cdabfe6a173c9f6cbcc86e6e7c9ce (diff) | |
download | ruby-0e3b349f7a250e14c8c93b52507e557344bce800.tar.gz ruby-0e3b349f7a250e14c8c93b52507e557344bce800.tar.xz ruby-0e3b349f7a250e14c8c93b52507e557344bce800.zip |
* eval.c (proc_invoke): should not overwrite block information in
current frame. [ruby-dev:28957]
* eval.c (rb_yield_0): retrieve proper block object from the frame
record.
* eval.c (proc_alloc): return preserved block object if it's
available.
* st.h (st_data_t): use pointer sized integer for st_data_t.
[ruby-dev:28988]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -2921,7 +2921,16 @@ block_param : block_param0 $$ = NEW_BLOCK_PARAM($9, NEW_MASGN($1, NEW_POSTARG($4,$6))); /*% $$ = blockvar_add_star(blockvar_new($1), $4); - $$ = blockvar_add_block($$, $6); + $$ = blockvar_add_block($$, $9); + %*/ + } + | block_param0 ',' tSTAR lhs ',' tAMPER lhs + { + /*%%%*/ + $$ = NEW_BLOCK_PARAM($7, NEW_MASGN($1, $4)); + /*% + $$ = blockvar_add_star(blockvar_new($1), $4); + $$ = blockvar_add_block($$, $7); %*/ } | block_param0 ',' tSTAR ',' tAMPER lhs @@ -2939,7 +2948,7 @@ block_param : block_param0 $$ = NEW_BLOCK_PARAM($8, NEW_MASGN($1, NEW_POSTARG(-1,$5))); /*% $$ = blockvar_add_star(blockvar_new($1), Qnil); - $$ = blockvar_add_block($$, $5); + $$ = blockvar_add_block($$, $8); %*/ } | block_param0 ',' tSTAR lhs @@ -3008,6 +3017,15 @@ block_param : block_param0 $$ = blockvar_add_star(blockvar_new(Qnil), $2); %*/ } + | tSTAR lhs ',' mlhs_post ',' tAMPER lhs + { + /*%%%*/ + $$ = NEW_BLOCK_PARAM($7, NEW_MASGN(0, NEW_POSTARG($2,$4))); + /*% + $$ = blockvar_add_star(blockvar_new(Qnil), Qnil); + $$ = blockvar_add_block($$, $7); + %*/ + } | tSTAR { /*%%%*/ @@ -3024,6 +3042,15 @@ block_param : block_param0 $$ = blockvar_add_star(blockvar_new(Qnil), Qnil); %*/ } + | tSTAR ',' mlhs_post ',' tAMPER lhs + { + /*%%%*/ + $$ = NEW_BLOCK_PARAM($6, NEW_MASGN(0, NEW_POSTARG(-1,$3))); + /*% + $$ = blockvar_add_star(blockvar_new(Qnil), Qnil); + $$ = blockvar_add_block($$, $6); + %*/ + } | tAMPER lhs { /*%%%*/ |