ruby-changes:45645
From: nobu <ko1@a...>
Date: Sun, 26 Feb 2017 18:33:28 +0900 (JST)
Subject: [ruby-changes:45645] nobu:r57718 (trunk): node.c: fix NODE_OP_ASGN1
nobu 2017-02-26 18:33:17 +0900 (Sun, 26 Feb 2017) New Revision: 57718 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57718 Log: node.c: fix NODE_OP_ASGN1 * node.c (dump_node): fix a typo, index and rvalue. fix NODE_OP_ASGN1 operator to nd_mid. [Fix GH-1528] Author: fate0 <fate0@u...> Modified files: trunk/node.c Index: node.c =================================================================== --- node.c (revision 57717) +++ node.c (revision 57718) @@ -426,10 +426,16 @@ dump_node(VALUE buf, VALUE indent, int c https://github.com/ruby/ruby/blob/trunk/node.c#L426 ANN("format: [nd_value] [ [nd_args->nd_body] ] [nd_vid]= [nd_args->nd_head]"); ANN("example: ary[1] += foo"); F_NODE(nd_recv, "receiver"); - F_ID(nd_vid, "operator"); - F_NODE(nd_args->nd_body, "index"); + F_CUSTOM1(nd_mid, "operator") { + switch (node->nd_mid) { + case 0: A("0 (||)"); break; + case 1: A("1 (&&)"); break; + default: A_ID(node->nd_mid); + } + }; + F_NODE(nd_args->nd_head, "index"); LAST_NODE; - F_NODE(nd_args->nd_head, "rvalue"); + F_NODE(nd_args->nd_body, "rvalue"); break; case NODE_OP_ASGN2: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/