Commit f89215c7 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

parser_dump: local variable dump condition updated

parent c3aa1c47
......@@ -5050,13 +5050,14 @@ parser_dump(mrb_state *mrb, node *tree, int offset)
{
node *n2 = tree->car;
if (n2) {
if (n2 && (n2->car || n2->cdr)) {
dump_prefix(offset+1);
printf("local variables:\n");
while (n2) {
if (n2->car) {
dump_prefix(offset+2);
printf("%s ", mrb_sym2name(mrb, (mrb_sym)n2->car));
}
n2 = n2->cdr;
}
printf("\n");
......@@ -5391,17 +5392,22 @@ parser_dump(mrb_state *mrb, node *tree, int offset)
dump_prefix(offset+1);
printf("%s\n", mrb_sym2name(mrb, (mrb_sym)tree->car));
tree = tree->cdr;
dump_prefix(offset+1);
printf("local variables:\n");
{
node *n2 = tree->car;
if (n2 && (n2->car || n2->cdr)) {
dump_prefix(offset+1);
printf("local variables:\n");
while (n2) {
if (n2->car) {
dump_prefix(offset+2);
if (n2->car)
printf("%s\n", mrb_sym2name(mrb, (mrb_sym)n2->car));
printf("%s ", mrb_sym2name(mrb, (mrb_sym)n2->car));
}
n2 = n2->cdr;
}
printf("\n");
}
}
tree = tree->cdr;
if (tree->car) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment