Commit 8f020f28 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

parser_dump: no print "local variables" if no local variables

parent dd550ca0
...@@ -5050,16 +5050,20 @@ parser_dump(mrb_state *mrb, node *tree, int offset) ...@@ -5050,16 +5050,20 @@ parser_dump(mrb_state *mrb, node *tree, int offset)
case NODE_SCOPE: case NODE_SCOPE:
printf("NODE_SCOPE:\n"); printf("NODE_SCOPE:\n");
dump_prefix(offset+1);
printf("local variables:\n");
{ {
node *n2 = tree->car; node *n2 = tree->car;
if (n2) {
dump_prefix(offset+1);
printf("local variables:\n");
while (n2) { while (n2) {
dump_prefix(offset+2); dump_prefix(offset+2);
printf("%s\n", mrb_sym2name(mrb, (mrb_sym)n2->car)); printf("%s ", mrb_sym2name(mrb, (mrb_sym)n2->car));
n2 = n2->cdr; n2 = n2->cdr;
} }
printf("\n");
}
} }
tree = tree->cdr; tree = tree->cdr;
offset++; offset++;
......
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