aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-26 09:33:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-26 09:33:17 +0000
commitc6b75f1cc691c91cdbbd8f4e8bb5c1571704a8ee (patch)
tree9faa0c2bea8447f76fb0b87b2e2f09f25af74a80 /node.c
parent96c01b455248598f981d78f7784b5b19e905dc54 (diff)
downloadruby-c6b75f1cc691c91cdbbd8f4e8bb5c1571704a8ee.tar.gz
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@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.c')
-rw-r--r--node.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/node.c b/node.c
index 3418db7fe2..f4f702d850 100644
--- a/node.c
+++ b/node.c
@@ -426,10 +426,16 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
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: