summaryrefslogtreecommitdiff
path: root/node.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-24 02:07:05 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-24 02:07:05 +0000
commit0fe72040e4c278bfafe232dc44551de2dfac85e2 (patch)
treeb94399addca7cc57efeb4ae755c408a09d99d115 /node.h
parentc5148e038316b3351b4c831773b83e08c11c20fb (diff)
* parse.y, node.h, compile.c: change node tree structure. a purpose
of this change is to unify argument structure of method and block. this change prohibits duplicate block parameter name. new argument infromation: NODE_ARGS [m: int, o: NODE_OPT_ARG, ->] NODE_ARGS_AUX [r: ID, b: ID, ->] NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*] optarg information: NODE_OPT_ARGS [idx, expr, ->] * vm_macro.def: ditto. * gc.c: ditto. * iseq.c: ditto. * compile.h: fix debug function name. * test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo| * test/ruby/test_lambda.rb: disalbe test temporarily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.h')
-rw-r--r--node.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/node.h b/node.h
index cf051c096b..c21158f9da 100644
--- a/node.h
+++ b/node.h
@@ -87,6 +87,8 @@ enum node_type {
NODE_DREGX,
NODE_DREGX_ONCE,
NODE_ARGS,
+ NODE_ARGS_AUX,
+ NODE_OPT_ARG,
NODE_POSTARG,
NODE_ARGSCAT,
NODE_ARGSPUSH,
@@ -209,9 +211,11 @@ typedef struct RNode {
#define nd_lit u1.value
-#define nd_frml u3.value
-#define nd_rest u2.node
+#define nd_frml u2.argc
+#define nd_rest u1.id
#define nd_opt u1.node
+#define nd_pid u1.id
+#define nd_plen u2.argc
#define nd_recv u1.node
#define nd_mid u2.id
@@ -315,8 +319,10 @@ typedef struct RNode {
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
#define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
#define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
-#define NEW_ARGS(f,o,r) NEW_NODE(NODE_ARGS,o,r,f)
-#define NEW_POSTARG(r,m) NEW_NODE(NODE_POSTARG,m,0,r)
+#define NEW_ARGS(m,o) NEW_NODE(NODE_ARGS,o,m,0)
+#define NEW_ARGS_AUX(r,b) NEW_NODE(NODE_ARGS_AUX,r,b,0)
+#define NEW_OPT_ARG(i,v) NEW_NODE(NODE_OPT_ARG,i,v,0)
+#define NEW_POSTARG(i,v) NEW_NODE(NODE_POSTARG,i,v,0)
#define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
#define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
#define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)