summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'node.c')
-rw-r--r--node.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/node.c b/node.c
index d8166a3cd6..1704fcaff4 100644
--- a/node.c
+++ b/node.c
@@ -22,7 +22,6 @@
#define A_INT(val) rb_str_catf(buf, "%d", (val))
#define A_LONG(val) rb_str_catf(buf, "%ld", (val))
#define A_LIT(lit) AR(rb_inspect(lit))
-#define A_OPERATOR(id) add_operator(buf, (id))
#define A_NODE_HEADER(node, term) \
rb_str_catf(buf, "@ %s (line: %d, code_range: (%d,%d)-(%d,%d))%s"term, \
ruby_node_name(nd_type(node)), nd_line(node), \
@@ -63,7 +62,6 @@
#define F_INT(name, ann) SIMPLE_FIELD1(#name, ann) A_INT(node->name)
#define F_LONG(name, ann) SIMPLE_FIELD1(#name, ann) A_LONG(node->name)
#define F_LIT(name, ann) SIMPLE_FIELD1(#name, ann) A_LIT(node->name)
-#define F_OPERATOR(name, ann) SIMPLE_FIELD1(#name, ann) A_OPERATOR(node->name)
#define F_MSG(name, ann, desc) SIMPLE_FIELD1(#name, ann) A(desc)
#define F_NODE(name, ann) \
@@ -99,16 +97,6 @@ add_id(VALUE buf, ID id)
}
}
-static void
-add_operator(VALUE buf, ID id)
-{
- switch (id) {
- case 0: A("0 (||)"); break;
- case 1: A("1 (&&)"); break;
- default: A_ID(id);
- }
-}
-
struct add_option_arg {
VALUE buf, indent;
st_index_t count;
@@ -435,7 +423,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const 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_OPERATOR(nd_mid, "operator");
+ F_ID(nd_mid, "operator");
F_NODE(nd_args->nd_head, "index");
LAST_NODE;
F_NODE(nd_args->nd_body, "rvalue");
@@ -451,7 +439,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
if (node->nd_next->nd_aid) A("? ");
A_ID(node->nd_next->nd_vid);
}
- F_OPERATOR(nd_next->nd_mid, "operator");
+ F_ID(nd_next->nd_mid, "operator");
LAST_NODE;
F_NODE(nd_value, "rvalue");
return;
@@ -476,7 +464,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
ANN("format: [nd_head](constant) [nd_aid]= [nd_value]");
ANN("example: A::B ||= 1");
F_NODE(nd_head, "constant");
- F_OPERATOR(nd_aid, "operator");
+ F_ID(nd_aid, "operator");
LAST_NODE;
F_NODE(nd_value, "rvalue");
return;