mruby-compiler: improve dynamic symbol dump to show node structure

Enhanced NODE_DSYM dump to use dump_node() instead of dump_str() for
the symbol's content list. Dynamic symbols (:"#{expr}") contain node
lists that may include complex interpolated expressions, not just simple
strings, so they need full node dumping to properly display their structure.

This provides much better visibility into interpolated symbol content
and makes debugging dynamic symbols more effective.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-09-30 14:01:33 +09:00
parent 4cb9e9f553
commit 75e2bb1ee0
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -7772,7 +7772,7 @@ dump_node(mrb_state *mrb, node *tree, int offset)
case NODE_DSYM:
printf("NODE_DSYM:\n");
dump_str(mrb, dsym_node(tree)->list, offset+1, lineno);
dump_node(mrb, dsym_node(tree)->list, offset+1);
break;
case NODE_LVAR:
+2 -2
View File
@@ -14601,7 +14601,7 @@ dump_node(mrb_state *mrb, node *tree, int offset)
case NODE_DSYM:
printf("NODE_DSYM:\n");
dump_str(mrb, dsym_node(tree)->list, offset+1, lineno);
dump_node(mrb, dsym_node(tree)->list, offset+1);
break;
case NODE_LVAR:
@@ -15037,7 +15037,7 @@ dump_node(mrb_state *mrb, node *tree, int offset)
printf("key:\n");
if (node_to_sym(pairs->car->car) == MRB_OPSYM(pow)) {
dump_prefix(offset+2, lineno);
printf("**:\n");
printf("**\n");
}
else {
dump_node(mrb, pairs->car->car, offset+2);