1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Compact AST::Node#inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-12-24 01:56:21 +00:00
parent d747ecc0c4
commit 04994454fd

7
ast.c
View file

@ -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;
}