diff --git a/ChangeLog b/ChangeLog index 8feaeb80803274..5719c3f4dfc351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 26 20:59:51 2011 Yusuke Endoh + + * node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack. + This is a preparation for keyword argument (see [ruby-core:40290]). + Mon Dec 26 22:01:19 2011 Hiroshi Shirosaki * io.c (rb_sys_fail_path): move the definition. diff --git a/node.h b/node.h index bb96107711a2bb..7c360cd6a94522 100644 --- a/node.h +++ b/node.h @@ -362,7 +362,7 @@ typedef struct RNode { #define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n) #define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i) #define NEW_ITER(a,b) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b),0) -#define NEW_LAMBDA(a) NEW_NODE(NODE_LAMBDA,a,0,0) +#define NEW_LAMBDA(a,b) NEW_NODE(NODE_LAMBDA,0,NEW_SCOPE(a,b),0) #define NEW_BREAK(s) NEW_NODE(NODE_BREAK,s,0,0) #define NEW_NEXT(s) NEW_NODE(NODE_NEXT,s,0,0) #define NEW_REDO() NEW_NODE(NODE_REDO,0,0,0) diff --git a/parse.y b/parse.y index 36bdd49370e687..ace81f9f192b38 100644 --- a/parse.y +++ b/parse.y @@ -3551,8 +3551,7 @@ lambda : { { lpar_beg = $2; /*%%%*/ - $$ = $3; - $$->nd_body = NEW_SCOPE($3->nd_head, $4); + $$ = NEW_LAMBDA($3, $4); /*% $$ = dispatch2(lambda, $3, $4); %*/ @@ -3563,7 +3562,7 @@ lambda : { f_larglist : '(' f_args opt_bv_decl rparen { /*%%%*/ - $$ = NEW_LAMBDA($2); + $$ = $2; /*% $$ = dispatch1(paren, $2); %*/ @@ -3571,7 +3570,7 @@ f_larglist : '(' f_args opt_bv_decl rparen | f_args { /*%%%*/ - $$ = NEW_LAMBDA($1); + $$ = $1; /*% $$ = $1; %*/