1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* node.h (NEW_NODE): cast arguments to rb_node_newnode().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-07-04 15:30:35 +00:00
parent 2c58277c5b
commit 9ae79bfcb9
4 changed files with 116 additions and 113 deletions

View file

@ -1,3 +1,7 @@
Sat Jul 5 00:22:59 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* node.h (NEW_NODE): cast arguments to rb_node_newnode().
Fri Jul 4 21:48:44 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> Fri Jul 4 21:48:44 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ext/syck/rubyext.c, ext/syck/syck.c, ext/syck/syck.h, * ext/syck/rubyext.c, ext/syck/syck.c, ext/syck/syck.h,

4
eval.c
View file

@ -909,7 +909,7 @@ static VALUE ruby_wrapper; /* security wrapper */
static NODE *ruby_cref = 0; static NODE *ruby_cref = 0;
static NODE *top_cref; static NODE *top_cref;
#define PUSH_CREF(c) ruby_cref = rb_node_newnode(NODE_CREF,(c),0,ruby_cref) #define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref)
#define POP_CREF() ruby_cref = ruby_cref->nd_next #define POP_CREF() ruby_cref = ruby_cref->nd_next
#define PUSH_SCOPE() do { \ #define PUSH_SCOPE() do { \
@ -1896,7 +1896,7 @@ copy_node_scope(node, rval)
NODE *node; NODE *node;
NODE *rval; NODE *rval;
{ {
NODE *copy = rb_node_newnode(NODE_SCOPE,0,rval,node->nd_next); NODE *copy = NEW_NODE(NODE_SCOPE,0,rval,node->nd_next);
if (node->nd_tbl) { if (node->nd_tbl) {
copy->nd_tbl = ALLOC_N(ID, node->nd_tbl[0]+1); copy->nd_tbl = ALLOC_N(ID, node->nd_tbl[0]+1);

200
node.h
View file

@ -234,108 +234,110 @@ typedef struct RNode {
#define nd_tag u1.id #define nd_tag u1.id
#define nd_tval u2.value #define nd_tval u2.value
#define NEW_METHOD(n,x) rb_node_newnode(NODE_METHOD,x,n,0) #define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
#define NEW_FBODY(n,i,o) rb_node_newnode(NODE_FBODY,n,i,o)
#define NEW_DEFN(i,a,d,p) rb_node_newnode(NODE_DEFN,p,i,NEW_RFUNC(a,d)) #define NEW_METHOD(n,x) NEW_NODE(NODE_METHOD,x,n,0)
#define NEW_DEFS(r,i,a,d) rb_node_newnode(NODE_DEFS,r,i,NEW_RFUNC(a,d)) #define NEW_FBODY(n,i,o) NEW_NODE(NODE_FBODY,n,i,o)
#define NEW_CFUNC(f,c) rb_node_newnode(NODE_CFUNC,f,c,0) #define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,p,i,NEW_RFUNC(a,d))
#define NEW_IFUNC(f,c) rb_node_newnode(NODE_IFUNC,f,c,0) #define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_RFUNC(a,d))
#define NEW_CFUNC(f,c) NEW_NODE(NODE_CFUNC,f,c,0)
#define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
#define NEW_RFUNC(b1,b2) NEW_SCOPE(block_append(b1,b2)) #define NEW_RFUNC(b1,b2) NEW_SCOPE(block_append(b1,b2))
#define NEW_SCOPE(b) rb_node_newnode(NODE_SCOPE,local_tbl(),0,(b)) #define NEW_SCOPE(b) NEW_NODE(NODE_SCOPE,local_tbl(),0,(b))
#define NEW_BLOCK(a) rb_node_newnode(NODE_BLOCK,a,0,0) #define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
#define NEW_IF(c,t,e) rb_node_newnode(NODE_IF,c,t,e) #define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t) #define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
#define NEW_CASE(h,b) rb_node_newnode(NODE_CASE,h,b,0) #define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0)
#define NEW_WHEN(c,t,e) rb_node_newnode(NODE_WHEN,c,t,e) #define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e)
#define NEW_OPT_N(b) rb_node_newnode(NODE_OPT_N,0,b,0) #define NEW_OPT_N(b) NEW_NODE(NODE_OPT_N,0,b,0)
#define NEW_WHILE(c,b,n) rb_node_newnode(NODE_WHILE,c,b,n) #define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
#define NEW_UNTIL(c,b,n) rb_node_newnode(NODE_UNTIL,c,b,n) #define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
#define NEW_FOR(v,i,b) rb_node_newnode(NODE_FOR,v,b,i) #define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i)
#define NEW_ITER(v,i,b) rb_node_newnode(NODE_ITER,v,b,i) #define NEW_ITER(v,i,b) NEW_NODE(NODE_ITER,v,b,i)
#define NEW_BREAK(s) rb_node_newnode(NODE_BREAK,s,0,0) #define NEW_BREAK(s) NEW_NODE(NODE_BREAK,s,0,0)
#define NEW_NEXT(s) rb_node_newnode(NODE_NEXT,s,0,0) #define NEW_NEXT(s) NEW_NODE(NODE_NEXT,s,0,0)
#define NEW_REDO() rb_node_newnode(NODE_REDO,0,0,0) #define NEW_REDO() NEW_NODE(NODE_REDO,0,0,0)
#define NEW_RETRY() rb_node_newnode(NODE_RETRY,0,0,0) #define NEW_RETRY() NEW_NODE(NODE_RETRY,0,0,0)
#define NEW_BEGIN(b) rb_node_newnode(NODE_BEGIN,0,b,0) #define NEW_BEGIN(b) NEW_NODE(NODE_BEGIN,0,b,0)
#define NEW_RESCUE(b,res,e) rb_node_newnode(NODE_RESCUE,b,res,e) #define NEW_RESCUE(b,res,e) NEW_NODE(NODE_RESCUE,b,res,e)
#define NEW_RESBODY(a,ex,n) rb_node_newnode(NODE_RESBODY,n,ex,a) #define NEW_RESBODY(a,ex,n) NEW_NODE(NODE_RESBODY,n,ex,a)
#define NEW_ENSURE(b,en) rb_node_newnode(NODE_ENSURE,b,0,en) #define NEW_ENSURE(b,en) NEW_NODE(NODE_ENSURE,b,0,en)
#define NEW_RETURN(s) rb_node_newnode(NODE_RETURN,s,0,0) #define NEW_RETURN(s) NEW_NODE(NODE_RETURN,s,0,0)
#define NEW_YIELD(a,s) rb_node_newnode(NODE_YIELD,a,0,s) #define NEW_YIELD(a,s) NEW_NODE(NODE_YIELD,a,0,s)
#define NEW_LIST(a) NEW_ARRAY(a) #define NEW_LIST(a) NEW_ARRAY(a)
#define NEW_ARRAY(a) rb_node_newnode(NODE_ARRAY,a,1,0) #define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
#define NEW_ZARRAY() rb_node_newnode(NODE_ZARRAY,0,0,0) #define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)
#define NEW_HASH(a) rb_node_newnode(NODE_HASH,a,0,0) #define NEW_HASH(a) NEW_NODE(NODE_HASH,a,0,0)
#define NEW_NOT(a) rb_node_newnode(NODE_NOT,0,a,0) #define NEW_NOT(a) NEW_NODE(NODE_NOT,0,a,0)
#define NEW_MASGN(l,r) rb_node_newnode(NODE_MASGN,l,0,r) #define NEW_MASGN(l,r) NEW_NODE(NODE_MASGN,l,0,r)
#define NEW_GASGN(v,val) rb_node_newnode(NODE_GASGN,v,val,rb_global_entry(v)) #define NEW_GASGN(v,val) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v))
#define NEW_LASGN(v,val) rb_node_newnode(NODE_LASGN,v,val,local_cnt(v)) #define NEW_LASGN(v,val) NEW_NODE(NODE_LASGN,v,val,local_cnt(v))
#define NEW_DASGN(v,val) rb_node_newnode(NODE_DASGN,v,val,0) #define NEW_DASGN(v,val) NEW_NODE(NODE_DASGN,v,val,0)
#define NEW_DASGN_CURR(v,val) rb_node_newnode(NODE_DASGN_CURR,v,val,0) #define NEW_DASGN_CURR(v,val) NEW_NODE(NODE_DASGN_CURR,v,val,0)
#define NEW_IASGN(v,val) rb_node_newnode(NODE_IASGN,v,val,0) #define NEW_IASGN(v,val) NEW_NODE(NODE_IASGN,v,val,0)
#define NEW_CDECL(v,val,path) rb_node_newnode(NODE_CDECL,v,val,path) #define NEW_CDECL(v,val,path) NEW_NODE(NODE_CDECL,v,val,path)
#define NEW_CVASGN(v,val) rb_node_newnode(NODE_CVASGN,v,val,0) #define NEW_CVASGN(v,val) NEW_NODE(NODE_CVASGN,v,val,0)
#define NEW_CVDECL(v,val) rb_node_newnode(NODE_CVDECL,v,val,0) #define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
#define NEW_OP_ASGN1(p,id,a) rb_node_newnode(NODE_OP_ASGN1,p,id,a) #define NEW_OP_ASGN1(p,id,a) NEW_NODE(NODE_OP_ASGN1,p,id,a)
#define NEW_OP_ASGN2(r,i,o,val) rb_node_newnode(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o)) #define NEW_OP_ASGN2(r,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
#define NEW_OP_ASGN22(i,o) rb_node_newnode(NODE_OP_ASGN2,i,o,rb_id_attrset(i)) #define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
#define NEW_OP_ASGN_OR(i,val) rb_node_newnode(NODE_OP_ASGN_OR,i,val,0) #define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
#define NEW_OP_ASGN_AND(i,val) rb_node_newnode(NODE_OP_ASGN_AND,i,val,0) #define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
#define NEW_GVAR(v) rb_node_newnode(NODE_GVAR,v,0,rb_global_entry(v)) #define NEW_GVAR(v) NEW_NODE(NODE_GVAR,v,0,rb_global_entry(v))
#define NEW_LVAR(v) rb_node_newnode(NODE_LVAR,v,0,local_cnt(v)) #define NEW_LVAR(v) NEW_NODE(NODE_LVAR,v,0,local_cnt(v))
#define NEW_DVAR(v) rb_node_newnode(NODE_DVAR,v,0,0); #define NEW_DVAR(v) NEW_NODE(NODE_DVAR,v,0,0);
#define NEW_IVAR(v) rb_node_newnode(NODE_IVAR,v,0,0) #define NEW_IVAR(v) NEW_NODE(NODE_IVAR,v,0,0)
#define NEW_CONST(v) rb_node_newnode(NODE_CONST,v,0,0) #define NEW_CONST(v) NEW_NODE(NODE_CONST,v,0,0)
#define NEW_CVAR(v) rb_node_newnode(NODE_CVAR,v,0,0) #define NEW_CVAR(v) NEW_NODE(NODE_CVAR,v,0,0)
#define NEW_NTH_REF(n) rb_node_newnode(NODE_NTH_REF,0,n,local_cnt('~')) #define NEW_NTH_REF(n) NEW_NODE(NODE_NTH_REF,0,n,local_cnt('~'))
#define NEW_BACK_REF(n) rb_node_newnode(NODE_BACK_REF,0,n,local_cnt('~')) #define NEW_BACK_REF(n) NEW_NODE(NODE_BACK_REF,0,n,local_cnt('~'))
#define NEW_MATCH(c) rb_node_newnode(NODE_MATCH,c,0,0) #define NEW_MATCH(c) NEW_NODE(NODE_MATCH,c,0,0)
#define NEW_MATCH2(n1,n2) rb_node_newnode(NODE_MATCH2,n1,n2,0) #define NEW_MATCH2(n1,n2) NEW_NODE(NODE_MATCH2,n1,n2,0)
#define NEW_MATCH3(r,n2) rb_node_newnode(NODE_MATCH3,r,n2,0) #define NEW_MATCH3(r,n2) NEW_NODE(NODE_MATCH3,r,n2,0)
#define NEW_LIT(l) rb_node_newnode(NODE_LIT,l,0,0) #define NEW_LIT(l) NEW_NODE(NODE_LIT,l,0,0)
#define NEW_STR(s) rb_node_newnode(NODE_STR,s,0,0) #define NEW_STR(s) NEW_NODE(NODE_STR,s,0,0)
#define NEW_DSTR(s) rb_node_newnode(NODE_DSTR,s,0,0) #define NEW_DSTR(s) NEW_NODE(NODE_DSTR,s,0,0)
#define NEW_XSTR(s) rb_node_newnode(NODE_XSTR,s,0,0) #define NEW_XSTR(s) NEW_NODE(NODE_XSTR,s,0,0)
#define NEW_DXSTR(s) rb_node_newnode(NODE_DXSTR,s,0,0) #define NEW_DXSTR(s) NEW_NODE(NODE_DXSTR,s,0,0)
#define NEW_DSYM(s) rb_node_newnode(NODE_DSYM,s,0,0) #define NEW_DSYM(s) NEW_NODE(NODE_DSYM,s,0,0)
#define NEW_EVSTR(n) rb_node_newnode(NODE_EVSTR,0,(n),0) #define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
#define NEW_CALL(r,m,a) rb_node_newnode(NODE_CALL,r,m,a) #define NEW_CALL(r,m,a) NEW_NODE(NODE_CALL,r,m,a)
#define NEW_FCALL(m,a) rb_node_newnode(NODE_FCALL,0,m,a) #define NEW_FCALL(m,a) NEW_NODE(NODE_FCALL,0,m,a)
#define NEW_VCALL(m) rb_node_newnode(NODE_VCALL,0,m,0) #define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
#define NEW_SUPER(a) rb_node_newnode(NODE_SUPER,0,0,a) #define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
#define NEW_ZSUPER() rb_node_newnode(NODE_ZSUPER,0,0,0) #define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
#define NEW_ARGS(f,o,r) rb_node_newnode(NODE_ARGS,o,r,f) #define NEW_ARGS(f,o,r) NEW_NODE(NODE_ARGS,o,r,f)
#define NEW_ARGSCAT(a,b) rb_node_newnode(NODE_ARGSCAT,a,b,0) #define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
#define NEW_ARGSPUSH(a,b) rb_node_newnode(NODE_ARGSPUSH,a,b,0) #define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
#define NEW_RESTARY(a) rb_node_newnode(NODE_RESTARY,a,0,0) #define NEW_RESTARY(a) NEW_NODE(NODE_RESTARY,a,0,0)
#define NEW_RESTARY2(a) rb_node_newnode(NODE_RESTARY2,a,0,0) #define NEW_RESTARY2(a) NEW_NODE(NODE_RESTARY2,a,0,0)
#define NEW_SPLAT(a) rb_node_newnode(NODE_SPLAT,a,0,0) #define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
#define NEW_SVALUE(a) rb_node_newnode(NODE_SVALUE,a,0,0) #define NEW_SVALUE(a) NEW_NODE(NODE_SVALUE,a,0,0)
#define NEW_BLOCK_ARG(v) rb_node_newnode(NODE_BLOCK_ARG,v,0,local_cnt(v)) #define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
#define NEW_BLOCK_PASS(b) rb_node_newnode(NODE_BLOCK_PASS,0,b,0) #define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)
#define NEW_ALIAS(n,o) rb_node_newnode(NODE_ALIAS,o,n,0) #define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,o,n,0)
#define NEW_VALIAS(n,o) rb_node_newnode(NODE_VALIAS,o,n,0) #define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,o,n,0)
#define NEW_UNDEF(i) rb_node_newnode(NODE_UNDEF,0,i,0) #define NEW_UNDEF(i) NEW_NODE(NODE_UNDEF,0,i,0)
#define NEW_CLASS(n,b,s) rb_node_newnode(NODE_CLASS,n,NEW_SCOPE(b),(s)) #define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(b),(s))
#define NEW_SCLASS(r,b) rb_node_newnode(NODE_SCLASS,r,NEW_SCOPE(b),0) #define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(b),0)
#define NEW_MODULE(n,b) rb_node_newnode(NODE_MODULE,n,NEW_SCOPE(b),0) #define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0)
#define NEW_COLON2(c,i) rb_node_newnode(NODE_COLON2,c,i,0) #define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
#define NEW_COLON3(i) rb_node_newnode(NODE_COLON3,0,i,0) #define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
#define NEW_CREF(c) (rb_node_newnode(NODE_CREF,0,0,c)) #define NEW_CREF(c) (NEW_NODE(NODE_CREF,0,0,c))
#define NEW_DOT2(b,e) rb_node_newnode(NODE_DOT2,b,e,0) #define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
#define NEW_DOT3(b,e) rb_node_newnode(NODE_DOT3,b,e,0) #define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
#define NEW_ATTRSET(a) rb_node_newnode(NODE_ATTRSET,a,0,0) #define NEW_ATTRSET(a) NEW_NODE(NODE_ATTRSET,a,0,0)
#define NEW_SELF() rb_node_newnode(NODE_SELF,0,0,0) #define NEW_SELF() NEW_NODE(NODE_SELF,0,0,0)
#define NEW_NIL() rb_node_newnode(NODE_NIL,0,0,0) #define NEW_NIL() NEW_NODE(NODE_NIL,0,0,0)
#define NEW_TRUE() rb_node_newnode(NODE_TRUE,0,0,0) #define NEW_TRUE() NEW_NODE(NODE_TRUE,0,0,0)
#define NEW_FALSE() rb_node_newnode(NODE_FALSE,0,0,0) #define NEW_FALSE() NEW_NODE(NODE_FALSE,0,0,0)
#define NEW_DEFINED(e) rb_node_newnode(NODE_DEFINED,e,0,0) #define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0)
#define NEW_NEWLINE(n) rb_node_newnode(NODE_NEWLINE,0,0,n) #define NEW_NEWLINE(n) NEW_NODE(NODE_NEWLINE,0,0,n)
#define NEW_PREEXE(b) NEW_SCOPE(b) #define NEW_PREEXE(b) NEW_SCOPE(b)
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0) #define NEW_POSTEXE() NEW_NODE(NODE_POSTEXE,0,0,0)
#define NEW_DMETHOD(b) rb_node_newnode(NODE_DMETHOD,0,0,b) #define NEW_DMETHOD(b) NEW_NODE(NODE_DMETHOD,0,0,b)
#define NEW_BMETHOD(b) rb_node_newnode(NODE_BMETHOD,0,0,b) #define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
#define NEW_ATTRASGN(r,m,a) rb_node_newnode(NODE_ATTRASGN,r,m,a) #define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
#define NOEX_PUBLIC 0 #define NOEX_PUBLIC 0
#define NOEX_NOSUPER 1 #define NOEX_NOSUPER 1
@ -351,7 +353,7 @@ NODE *rb_compile_string _((const char*, VALUE, int));
NODE *rb_compile_file _((const char*, VALUE, int)); NODE *rb_compile_file _((const char*, VALUE, int));
void rb_add_method _((VALUE, ID, NODE *, int)); void rb_add_method _((VALUE, ID, NODE *, int));
NODE *rb_node_newnode(ANYARGS); NODE *rb_node_newnode _((enum node_type,VALUE,VALUE,VALUE));
struct global_entry *rb_global_entry _((ID)); struct global_entry *rb_global_entry _((ID));
VALUE rb_gvar_get _((struct global_entry *)); VALUE rb_gvar_get _((struct global_entry *));

21
parse.y
View file

@ -1908,8 +1908,7 @@ xstring : tXSTRING_BEG xstring_contents tSTRING_END
nd_set_type(node, NODE_DXSTR); nd_set_type(node, NODE_DXSTR);
break; break;
default: default:
node = rb_node_newnode(NODE_DXSTR, rb_str_new(0, 0), node = NEW_NODE(NODE_DXSTR, rb_str_new(0, 0), 1, NEW_LIST(node));
1, NEW_LIST(node));
break; break;
} }
} }
@ -1935,8 +1934,7 @@ regexp : tREGEXP_BEG xstring_contents tREGEXP_END
} }
break; break;
default: default:
node = rb_node_newnode(NODE_DSTR, rb_str_new(0, 0), node = NEW_NODE(NODE_DSTR, rb_str_new(0, 0), 1, NEW_LIST(node));
1, NEW_LIST(node));
case NODE_DSTR: case NODE_DSTR:
if (options & RE_OPTION_ONCE) { if (options & RE_OPTION_ONCE) {
nd_set_type(node, NODE_DREGX_ONCE); nd_set_type(node, NODE_DREGX_ONCE);
@ -2104,8 +2102,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END
} }
/* fall through */ /* fall through */
default: default:
$$ = rb_node_newnode(NODE_DSYM, rb_str_new(0, 0), $$ = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST($$));
1, NEW_LIST($$));
break; break;
} }
} }
@ -4421,7 +4418,7 @@ yylex()
NODE* NODE*
rb_node_newnode(type, a0, a1, a2) rb_node_newnode(type, a0, a1, a2)
enum node_type type; enum node_type type;
NODE *a0, *a1, *a2; VALUE a0, a1, a2;
{ {
NODE *n = (NODE*)rb_newobj(); NODE *n = (NODE*)rb_newobj();
@ -4430,9 +4427,9 @@ rb_node_newnode(type, a0, a1, a2)
nd_set_line(n, ruby_sourceline); nd_set_line(n, ruby_sourceline);
n->nd_file = ruby_sourcefile; n->nd_file = ruby_sourcefile;
n->u1.node = a0; n->u1.value = a0;
n->u2.node = a1; n->u2.value = a1;
n->u3.node = a2; n->u3.value = a2;
return n; return n;
} }
@ -5341,10 +5338,10 @@ logop(type, left, right)
while ((second = node->nd_2nd) != 0 && nd_type(second) == type) { while ((second = node->nd_2nd) != 0 && nd_type(second) == type) {
node = second; node = second;
} }
node->nd_2nd = rb_node_newnode(type, second, right, 0); node->nd_2nd = NEW_NODE(type, second, right, 0);
return left; return left;
} }
return rb_node_newnode(type, left, right, 0); return NEW_NODE(type, left, right, 0);
} }
static int static int