node.c: show variable type for NODE_*ASGN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
641870746f
commit
57b0489cdb
58
node.c
58
node.c
@ -377,37 +377,47 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
|
|||||||
ANN("local variable assignment");
|
ANN("local variable assignment");
|
||||||
ANN("format: [nd_vid](lvar) = [nd_value]");
|
ANN("format: [nd_vid](lvar) = [nd_value]");
|
||||||
ANN("example: x = foo");
|
ANN("example: x = foo");
|
||||||
goto asgn;
|
F_ID(nd_vid, "local variable");
|
||||||
case NODE_DASGN:
|
|
||||||
ANN("dynamic variable assignment (out of current scope)");
|
|
||||||
ANN("format: [nd_vid](dvar) = [nd_value]");
|
|
||||||
ANN("example: x = nil; 1.times { x = foo }");
|
|
||||||
goto asgn;
|
|
||||||
case NODE_DASGN_CURR:
|
|
||||||
ANN("dynamic variable assignment (in current scope)");
|
|
||||||
ANN("format: [nd_vid](current dvar) = [nd_value]");
|
|
||||||
ANN("example: 1.times { x = foo }");
|
|
||||||
goto asgn;
|
|
||||||
case NODE_IASGN:
|
|
||||||
ANN("instance variable assignment");
|
|
||||||
ANN("format: [nd_vid](ivar) = [nd_value]");
|
|
||||||
ANN("example: @x = foo");
|
|
||||||
goto asgn;
|
|
||||||
case NODE_CVASGN:
|
|
||||||
ANN("class variable assignment");
|
|
||||||
ANN("format: [nd_vid](cvar) = [nd_value]");
|
|
||||||
ANN("example: @@x = foo");
|
|
||||||
asgn:
|
|
||||||
F_ID(nd_vid, "variable");
|
|
||||||
LAST_NODE;
|
|
||||||
if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
|
if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
|
||||||
F_MSG(nd_value, "rvalue", "NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
|
F_MSG(nd_value, "rvalue", "NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
LAST_NODE;
|
||||||
F_NODE(nd_value, "rvalue");
|
F_NODE(nd_value, "rvalue");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case NODE_DASGN:
|
||||||
|
ANN("dynamic variable assignment (out of current scope)");
|
||||||
|
ANN("format: [nd_vid](dvar) = [nd_value]");
|
||||||
|
ANN("example: x = nil; 1.times { x = foo }");
|
||||||
|
F_ID(nd_vid, "local variable");
|
||||||
|
LAST_NODE;
|
||||||
|
F_NODE(nd_value, "rvalue");
|
||||||
|
return;
|
||||||
|
case NODE_DASGN_CURR:
|
||||||
|
ANN("dynamic variable assignment (in current scope)");
|
||||||
|
ANN("format: [nd_vid](current dvar) = [nd_value]");
|
||||||
|
ANN("example: 1.times { x = foo }");
|
||||||
|
F_ID(nd_vid, "local variable");
|
||||||
|
LAST_NODE;
|
||||||
|
F_NODE(nd_value, "rvalue");
|
||||||
|
return;
|
||||||
|
case NODE_IASGN:
|
||||||
|
ANN("instance variable assignment");
|
||||||
|
ANN("format: [nd_vid](ivar) = [nd_value]");
|
||||||
|
ANN("example: @x = foo");
|
||||||
|
F_ID(nd_vid, "instance variable");
|
||||||
|
LAST_NODE;
|
||||||
|
F_NODE(nd_value, "rvalue");
|
||||||
|
return;
|
||||||
|
case NODE_CVASGN:
|
||||||
|
ANN("class variable assignment");
|
||||||
|
ANN("format: [nd_vid](cvar) = [nd_value]");
|
||||||
|
ANN("example: @@x = foo");
|
||||||
|
F_ID(nd_vid, "class variable");
|
||||||
|
LAST_NODE;
|
||||||
|
F_NODE(nd_value, "rvalue");
|
||||||
|
return;
|
||||||
case NODE_GASGN:
|
case NODE_GASGN:
|
||||||
ANN("global variable assignment");
|
ANN("global variable assignment");
|
||||||
ANN("format: [nd_entry](gvar) = [nd_value]");
|
ANN("format: [nd_entry](gvar) = [nd_value]");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user