ruby-changes:48082
From: yui-knk <ko1@a...>
Date: Tue, 17 Oct 2017 20:13:58 +0900 (JST)
Subject: [ruby-changes:48082] yui-knk:r60196 (trunk): node.c: Add NODE_OP_CDECL to dump node list.
yui-knk 2017-10-17 20:13:53 +0900 (Tue, 17 Oct 2017) New Revision: 60196 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60196 Log: node.c: Add NODE_OP_CDECL to dump node list. * node.c (dump_node): Add NODE_OP_CDECL to dump node list. Modified files: trunk/node.c Index: node.c =================================================================== --- node.c (revision 60195) +++ node.c (revision 60196) @@ -484,6 +484,22 @@ dump_node(VALUE buf, VALUE indent, int c https://github.com/ruby/ruby/blob/trunk/node.c#L484 F_NODE(nd_value, "rvalue"); break; + case NODE_OP_CDECL: + ANN("constant declaration with operator"); + ANN("format: [nd_head](constant) [nd_aid]= [nd_value]"); + ANN("example: A::B ||= 1"); + F_NODE(nd_head, "variable"); + F_CUSTOM1(nd_aid, "operator") { + switch (node->nd_aid) { + case 0: A("0 (||)"); break; + case 1: A("1 (&&)"); break; + default: A_ID(node->nd_mid); + } + }; + LAST_NODE; + F_NODE(nd_value, "rvalue"); + break; + case NODE_CALL: case NODE_OPCALL: ANN("method invocation"); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/