ast.c: use enum in switch for warnings

* ext/-test-/ast/ast.c (node_children): use enum instead of int
  for not-handled enumeration value in switch warnings.

* ext/-test-/ast/ast.c (node_children): fix the rb_bug message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-05-01 06:55:43 +00:00
Родитель 496ddbc275
Коммит 41f4ac6aa2
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -179,7 +179,8 @@ dump_array(rb_ast_t *ast, NODE *node)
static VALUE
node_children(rb_ast_t *ast, NODE *node)
{
switch (nd_type(node)) {
enum node_type type = nd_type(node);
switch (type) {
case NODE_BLOCK:
return dump_block(ast, node);
case NODE_IF:
@ -227,7 +228,6 @@ node_children(rb_ast_t *ast, NODE *node)
andor:
{
VALUE ary = rb_ary_new();
enum node_type type = nd_type(node);
while (1) {
rb_ary_push(ary, NEW_CHILD(ast, node->nd_1st));
@ -417,7 +417,7 @@ node_children(rb_ast_t *ast, NODE *node)
break;
}
rb_bug("dump_node: unknown node: %s", ruby_node_name(nd_type(node)));
rb_bug("node_children: unknown node: %s", ruby_node_name(type));
}
static VALUE