summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 01:56:21 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-24 01:56:21 (GMT)
commit04994454fdf21e59b88f65f57e8f44e57bfa4b07 (patch)
tree7a65055ae1359460a8d10f689c46a20cb4b74cd7
parentd747ecc0c41a7a138c0ae6112356707725653a3e (diff)
Compact AST::Node#inspect
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ast.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ast.c b/ast.c
index d6a3073..c3f28eb 100644
--- a/ast.c
+++ b/ast.c
@@ -721,9 +721,10 @@ rb_ast_node_inspect(VALUE self)
str = rb_str_new2("#<");
rb_str_append(str, cname);
- rb_str_cat2(str, "(");
- rb_str_catf(str, "%s(%d) %d:%d, %d:%d", node_type_to_str(data->node), nd_type(data->node), nd_first_lineno(data->node), nd_first_column(data->node), nd_last_lineno(data->node), nd_last_column(data->node));
- rb_str_cat2(str, "): >");
+ rb_str_catf(str, ":%s@%d:%d-%d:%d>",
+ node_type_to_str(data->node),
+ nd_first_lineno(data->node), nd_first_column(data->node),
+ nd_last_lineno(data->node), nd_last_column(data->node));
return str;
}