mruby-compiler: update mrb_parser_dump for variable-sized nodes

Modernize the parser dump functionality to support the post-NODE_VARIABLE
hybrid AST architecture with both variable-sized nodes and traditional
cons-list nodes.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-09-25 17:36:50 +09:00
parent 6a3e26cf7a
commit 821b989b33
4 changed files with 2361 additions and 2110 deletions
+1 -1
View File
@@ -4700,7 +4700,7 @@ static void
gen_super_var(codegen_scope *s, node *varnode, int val)
{
struct mrb_ast_super_node *super_n = super_node(varnode);
node *tree = SUPER_NODE_ARGS(super_n);
node *tree = super_n->args;
codegen_scope *s2 = s;
int lv = 0;
+6 -3
View File
@@ -433,7 +433,12 @@ struct mrb_ast_super_node {
#define DEF_NODE_NAME(n) (def_node(n)->name)
#define DEF_NODE_ARGS(n) (def_node(n)->args)
#define DEF_NODE_BODY(n) (def_node(n)->body)
#define DEF_NODE_LOCALS(n) (def_node(n)->locals)
#define SDEF_NODE_NAME(n) (sdef_node(n)->name)
#define SDEF_NODE_ARGS(n) (sdef_node(n)->args)
#define SDEF_NODE_BODY(n) (sdef_node(n)->body)
#define SDEF_NODE_LOCALS(n) (sdef_node(n)->locals)
#define SDEF_NODE_OBJ(n) (sdef_node(n)->body)
#define CLASS_NODE_NAME(n) (class_node(n)->name)
#define CLASS_NODE_SUPERCLASS(n) (class_node(n)->superclass)
#define CLASS_NODE_BODY(n) (class_node(n)->body)
@@ -463,9 +468,7 @@ struct mrb_ast_super_node {
#define OR_NODE_RIGHT(n) (or_node(n)->right)
#define RETURN_NODE_ARGS(n) (return_node(n)->args)
#define YIELD_NODE_ARGS(n) (yield_node(n)->args)
#define SUPER_NODE_ARGS(n) (super_node(n)->args)
/* Variable-sized literal node structures */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff