summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-26 14:19:52 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-26 14:19:52 +0000
commit90b1afa3104659898aad5978b164d48e1809e228 (patch)
tree28ff19b0f189ec68a5bd554cbb647ecf715b969a
parent68fde4449ac3a085a6fb47b44f983d547b9fece2 (diff)
* node.h, parse.y (lambda, f_larglist): remove NEW_LAMBDA hack. This is a preparation for keyword argument (see [ruby-core:40290]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--node.h2
-rw-r--r--parse.y7
3 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8feaeb8..5719c3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Dec 26 20:59:51 2011 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * 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 <h.shirosaki@gmail.com>
* io.c (rb_sys_fail_path): move the definition.
diff --git a/node.h b/node.h
index bb96107..7c360cd 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 36bdd49..ace81f9 100644
--- a/parse.y
+++ b/parse.y
@@ -3551,8 +3551,7 @@ lambda : {
{
lpar_beg = $<num>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;
%*/