mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-compiler: remove NODE_VARIABLE wrapper and modernize AST handling
This removes the NODE_VARIABLE enum and associated wrapper system, updating the parser and codegen to work directly with variable-sized AST nodes. Key changes: - Removed NODE_VARIABLE from node.h enum - Updated parser functions to handle direct variable-sized nodes - Fixed codegen() main dispatch to detect variable-sized nodes directly - Added helper functions for node type detection and header access - Updated all parser and codegen functions to work with modern AST structure Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -85,7 +85,6 @@ enum node_type {
|
||||
NODE_HEREDOC,
|
||||
NODE_WORDS,
|
||||
NODE_SYMBOLS,
|
||||
NODE_VARIABLE,
|
||||
NODE_LAST
|
||||
};
|
||||
|
||||
@@ -359,10 +358,6 @@ struct mrb_ast_super_node {
|
||||
#define node_to_type(x) ((enum node_type)(intptr_t)(x))
|
||||
#define node_to_char(x) ((char)(intptr_t)(x))
|
||||
|
||||
// Macros for variable-sized nodes
|
||||
#define NODE_TYPE(n) ((enum node_type)(intptr_t)((n)->car))
|
||||
#define NODE_VAR_NODE_PTR(n) ((struct mrb_ast_var_header*)((n)->cdr))
|
||||
|
||||
/* Phase 1 node casting macros */
|
||||
#define sym_node(n) ((struct mrb_ast_sym_node*)(n))
|
||||
#define str_node(n) ((struct mrb_ast_str_node*)(n))
|
||||
|
||||
+204
-229
File diff suppressed because it is too large
Load Diff
+1192
-1216
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user