本文整理汇总了C++中HashNode::child方法的典型用法代码示例。如果您正苦于以下问题:C++ HashNode::child方法的具体用法?C++ HashNode::child怎么用?C++ HashNode::child使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HashNode
的用法示例。
在下文中一共展示了HashNode::child方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parser_dump
//.........这里部分代码省略.........
parser_dump(mrb, nd->rhs(), offset+1);
}
break;
case NODE_DOT3:
{
printf("NODE_DOT3:\n");
Dot3Node *nd = (Dot3Node *)orig;
parser_dump(mrb, nd->lhs(), offset+1);
parser_dump(mrb, nd->rhs(), offset+1);
}
break;
case NODE_COLON2:
{
Colon2Node *cn = (Colon2Node *)orig;
printf("NODE_COLON2:\n");
parser_dump(mrb, cn->m_val, offset+1);
dump_prefix(offset+1);
printf("::%s\n", mrb_sym2name(mrb, cn->m_sym));
}
break;
case NODE_COLON3:{
printf("NODE_COLON3:\n");
dump_prefix(offset+1);
Colon3Node *n = (Colon3Node *)orig;
printf("::%s\n", mrb_sym2name(mrb, n->sym()));
}
break;
case NODE_ARRAY:
printf("NODE_ARRAY:\n");
dump_recur(mrb, ((ArrayNode *)orig)->child(), offset+1);
break;
case NODE_HASH:
{
HashNode *nd = (HashNode *)orig;
printf("NODE_HASH:\n");
tree = nd->child();
while (tree) {
dump_prefix(offset+1);
printf("key:\n");
parser_dump(mrb, tree->left()->left(), offset+2);
dump_prefix(offset+1);
printf("value:\n");
parser_dump(mrb, tree->left()->right(), offset+2);
tree = tree->right();
}
}
break;
case NODE_SPLAT:
printf("NODE_SPLAT:\n");
parser_dump(mrb, ((SplatNode *)orig)->child(), offset+1);
break;
case NODE_ASGN:
{
AsgnNode *an = (AsgnNode *)orig;
printf("NODE_ASGN:\n");
dump_prefix(offset+1);
printf("lhs:\n");
parser_dump(mrb, an->lhs(), offset+2);
dump_prefix(offset+1);