From 13a542d48d5d86b866dbc4d6a4f0ec17bee49c12 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Mon, 11 Jun 2012 15:55:04 +0900 Subject: zsuper should respect block given; close #185 --- src/parse.y | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/parse.y') diff --git a/src/parse.y b/src/parse.y index 3f542a3b3..d31711b68 100644 --- a/src/parse.y +++ b/src/parse.y @@ -754,11 +754,21 @@ args_with_block(parser_state *p, node *a, node *b) static void call_with_block(parser_state *p, node *a, node *b) { - node *n = a->cdr->cdr->cdr; + node *n; - if (!n->car) n->car = cons(0, b); + if (a->car == (node*)NODE_SUPER || + a->car == (node*)NODE_ZSUPER) { + if (!a->cdr) a->cdr = cons(0, b); + else { + args_with_block(p, a->cdr, b); + } + } else { - args_with_block(p, n->car, b); + n = a->cdr->cdr->cdr; + if (!n->car) n->car = cons(0, b); + else { + args_with_block(p, n->car, b); + } } } -- cgit v1.2.3