summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-23 07:05:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-23 07:05:59 +0000
commit552fb72159d3bb27ff40ecc121bbc52a3fff89a1 (patch)
treed6abf2514a01ce6f2ff5160cea2d132933af3973 /parse.y
parent44cf56d6e70dbe06a160b004494ba40dd4cfb426 (diff)
2000-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 14 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 75c0ad8acd..7b47c7f6ed 100644
--- a/parse.y
+++ b/parse.y
@@ -83,6 +83,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();
@@ -451,7 +452,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);
}
@@ -1390,7 +1391,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
{
@@ -4387,6 +4388,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;