mruby-compiler: rename operator field to op for c++ compatibility

Rename mrb_ast_op_asgn_node.operator field to op to avoid conflict with
C++ operator keyword. Update all references including macro definitions
and field access code.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-09-16 15:08:40 +09:00
parent cbe01d574c
commit 9a680d11ef
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -4533,7 +4533,7 @@ gen_op_asgn_var(codegen_scope *s, node *varnode, int val)
struct mrb_ast_op_asgn_node *op_asgn_n = op_asgn_node(varnode);
node *lhs = op_asgn_n->lhs;
node *rhs = op_asgn_n->rhs;
mrb_sym sym = op_asgn_n->operator;
mrb_sym sym = op_asgn_n->op;
mrb_int len;
const char *name = mrb_sym_name_len(s->mrb, sym, &len);
int vsp = -1;
+2 -2
View File
@@ -337,7 +337,7 @@ struct mrb_ast_masgn_node {
struct mrb_ast_op_asgn_node {
struct mrb_ast_var_header header; /* 8 bytes */
struct mrb_ast_node *lhs; /* Left-hand side (target) */
mrb_sym operator; /* Assignment operator (e.g., +=, -=, etc.) */
mrb_sym op; /* Assignment operator (e.g., +=, -=, etc.) */
struct mrb_ast_node *rhs; /* Right-hand side (value) */
};
@@ -495,7 +495,7 @@ struct mrb_ast_super_node {
#define MASGN_NODE_RHS(n) (masgn_node(n)->rhs)
#define OP_ASGN_NODE_LHS(n) (op_asgn_node(n)->lhs)
#define OP_ASGN_NODE_OP(n) (op_asgn_node(n)->operator)
#define OP_ASGN_NODE_OP(n) (op_asgn_node(n)->op)
#define OP_ASGN_NODE_RHS(n) (op_asgn_node(n)->rhs)
/* Expression node value access macros */
+1 -1
View File
@@ -1574,7 +1574,7 @@ new_op_asgn(parser_state *p, node *a, mrb_sym op, node *b)
struct mrb_ast_op_asgn_node *n = (struct mrb_ast_op_asgn_node*)parser_alloc_var(p, total_size, class);
init_var_header(&n->header, p, NODE_OP_ASGN, class);
n->lhs = a;
n->operator = op;
n->op = op;
n->rhs = b;
return cons_head((node*)NODE_VARIABLE, (node*)n);
}
+1 -1
View File
@@ -1636,7 +1636,7 @@ new_op_asgn(parser_state *p, node *a, mrb_sym op, node *b)
struct mrb_ast_op_asgn_node *n = (struct mrb_ast_op_asgn_node*)parser_alloc_var(p, total_size, class);
init_var_header(&n->header, p, NODE_OP_ASGN, class);
n->lhs = a;
n->operator = op;
n->op = op;
n->rhs = b;
return cons_head((node*)NODE_VARIABLE, (node*)n);
}