mruby-compiler: revert new_call function to always use traditional cons-list nodes

Temporarily revert new_call to avoid issues with assignment to method calls
like self[idx] = value causing "unknown lhs" errors. The function now always
uses traditional cons-list NODE_CALL/NODE_SCALL nodes instead of variable-sized
nodes to maintain compatibility with existing assignment codegen.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-09-03 14:14:38 +09:00
parent 87de799cd5
commit 4dafdc72fc
2 changed files with 1041 additions and 1051 deletions
+2 -7
View File
@@ -587,9 +587,7 @@ new_alias(parser_state *p, mrb_sym a, mrb_sym b)
return cons_head((node*)NODE_VARIABLE, (node*)alias_node);
}
/* Forward declaration for variable-sized call node */
/* Forward declarations for variable-sized AST node creation functions */
static node* new_call_var(parser_state *p, node *receiver, mrb_sym method, node *args, int pass);
static node* new_array_var(parser_state *p, node *a);
static node* new_hash_var(parser_state *p, node *a);
static node* new_if_var(parser_state *p, node *condition, node *then_body, node *else_body);
@@ -739,20 +737,16 @@ new_self(parser_state *p)
return list1((node*)NODE_SELF);
}
/* (:call a b c) */
static node*
new_call(parser_state *p, node *a, mrb_sym b, node *c, int pass)
{
if (p->var_nodes_enabled) {
return new_call_var(p, a, b, c, pass);
}
node *n = list4(int_to_node(pass?NODE_CALL:NODE_SCALL), a, sym_to_node(b), c);
void_expr_error(p, a);
return n;
}
#if 0
/* Variable-sized call node creation */
static node*
new_call_var(parser_state *p, node *receiver, mrb_sym method, node *args, int pass)
@@ -820,6 +814,7 @@ new_call_var(parser_state *p, node *receiver, mrb_sym method, node *args, int pa
void_expr_error(p, receiver);
return cons_head((node*)NODE_VARIABLE, (node*)n);
}
#endif
/* Variable-sized array node creation */
static node*
File diff suppressed because it is too large Load Diff