From f2957904aa12351a394527fd3da7507b9c4b241a Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 30 Sep 2025 22:54:00 +0900 Subject: [PATCH] mruby-compiler: remove unused mrb_ast_when_node structure removed struct mrb_ast_when_node and when_node() casting macro which were never actually used. NODE_CASE uses cons lists to represent when clauses, not dedicated when_node structures. the structure definition and macro were dead code left over from earlier design. case/when implementation uses: cons(cons(conditions, body), next_when) where each when clause is a cons cell in a list, not a typed node. Co-authored-by: Claude --- mrbgems/mruby-compiler/core/node.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mrbgems/mruby-compiler/core/node.h b/mrbgems/mruby-compiler/core/node.h index a1b42d832..3a1323a65 100644 --- a/mrbgems/mruby-compiler/core/node.h +++ b/mrbgems/mruby-compiler/core/node.h @@ -644,13 +644,6 @@ struct mrb_ast_iter_node { struct mrb_ast_node *body; }; -struct mrb_ast_when_node { - struct mrb_ast_var_header header; - struct mrb_ast_node *cond; - struct mrb_ast_node *body; - struct mrb_ast_node *next_when; -}; - // Group 16: Declarations and Definitions struct mrb_ast_alias_node { @@ -681,7 +674,6 @@ struct mrb_ast_postexe_node { #define ensure_node(n) ((struct mrb_ast_ensure_node*)(n)) #define stmts_node(n) ((struct mrb_ast_stmts_node*)(n)) #define iter_node(n) ((struct mrb_ast_iter_node*)(n)) -#define when_node(n) ((struct mrb_ast_when_node*)(n)) #define alias_node(n) ((struct mrb_ast_alias_node*)(n)) #define undef_node(n) ((struct mrb_ast_undef_node*)(n)) #define postexe_node(n) ((struct mrb_ast_postexe_node*)(n))