diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-23 07:05:59 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-23 07:05:59 +0000 |
commit | dc074ec107e288dfc7b40d45afe3009c968021ca (patch) | |
tree | 7f28628ea80b0ead6ad861021d3aea398b750256 /parse.y | |
parent | ed7cd88b0d7e89ea34aff78903fa83c4c5d6bb32 (diff) |
2000-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -81,6 +81,7 @@ static int in_defined = 0; static NODE *arg_blk_pass(); static NODE *new_call(); static NODE *new_fcall(); +static NODE *new_super(); static NODE *gettable(); static NODE *assignable(); @@ -444,7 +445,7 @@ command_call : operation call_args { if (!compile_for_eval && !cur_mid && !in_single) yyerror("super called outside of method"); - $$ = NEW_SUPER($2); + $$ = new_super($2); fixpos($$, $2); } @@ -1393,7 +1394,7 @@ method_call : operation '(' opt_call_args close_paren if (!compile_for_eval && !cur_mid && !in_single && !in_defined) yyerror("super called outside of method"); - $$ = NEW_SUPER($3); + $$ = new_super($3); } | kSUPER { @@ -4200,6 +4201,17 @@ new_fcall(m,a) return NEW_FCALL(m,a); } +static NODE* +new_super(a) + NODE *a; +{ + if (a && nd_type(a) == NODE_BLOCK_PASS) { + a->nd_iter = NEW_SUPER(a->nd_head); + return a; + } + return NEW_SUPER(a); +} + static struct local_vars { ID *tbl; int nofree; |