diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-04 15:30:35 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-04 15:30:35 +0000 |
commit | 9ae79bfcb96a4cc4ff62cb8c4f858f1197ea7ee6 (patch) | |
tree | 14f7915a1474f31374a10f1339dc16307fbf8450 /parse.y | |
parent | 2c58277c5b52693d9b89dbec682b3e07da98f982 (diff) | |
download | ruby-9ae79bfcb96a4cc4ff62cb8c4f858f1197ea7ee6.tar.gz |
* 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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -1908,8 +1908,7 @@ xstring : tXSTRING_BEG xstring_contents tSTRING_END nd_set_type(node, NODE_DXSTR); break; default: - node = rb_node_newnode(NODE_DXSTR, rb_str_new(0, 0), - 1, NEW_LIST(node)); + node = NEW_NODE(NODE_DXSTR, rb_str_new(0, 0), 1, NEW_LIST(node)); break; } } @@ -1935,8 +1934,7 @@ regexp : tREGEXP_BEG xstring_contents tREGEXP_END } break; default: - node = rb_node_newnode(NODE_DSTR, rb_str_new(0, 0), - 1, NEW_LIST(node)); + node = NEW_NODE(NODE_DSTR, rb_str_new(0, 0), 1, NEW_LIST(node)); case NODE_DSTR: if (options & RE_OPTION_ONCE) { nd_set_type(node, NODE_DREGX_ONCE); @@ -2104,8 +2102,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END } /* fall through */ default: - $$ = rb_node_newnode(NODE_DSYM, rb_str_new(0, 0), - 1, NEW_LIST($$)); + $$ = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST($$)); break; } } @@ -4421,7 +4418,7 @@ yylex() NODE* rb_node_newnode(type, a0, a1, a2) enum node_type type; - NODE *a0, *a1, *a2; + VALUE a0, a1, a2; { NODE *n = (NODE*)rb_newobj(); @@ -4430,9 +4427,9 @@ rb_node_newnode(type, a0, a1, a2) nd_set_line(n, ruby_sourceline); n->nd_file = ruby_sourcefile; - n->u1.node = a0; - n->u2.node = a1; - n->u3.node = a2; + n->u1.value = a0; + n->u2.value = a1; + n->u3.value = a2; return n; } @@ -5341,10 +5338,10 @@ logop(type, left, right) while ((second = node->nd_2nd) != 0 && nd_type(second) == type) { node = second; } - node->nd_2nd = rb_node_newnode(type, second, right, 0); + node->nd_2nd = NEW_NODE(type, second, right, 0); return left; } - return rb_node_newnode(type, left, right, 0); + return NEW_NODE(type, left, right, 0); } static int |