Skip to content

Commit 25072d2

Browse files
yui-knknobu
authored andcommitted
Fix node type casts
Use new node type set by nd_set_type.
1 parent a405b28 commit 25072d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parse.y

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12826,7 +12826,7 @@ symbol_append(struct parser_params *p, NODE *symbols, NODE *symbol)
1282612826
break;
1282712827
case NODE_STR:
1282812828
nd_set_type(symbol, NODE_LIT);
12829-
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(symbol)->nd_lit = rb_str_intern(RNODE_STR(symbol)->nd_lit));
12829+
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(symbol)->nd_lit = rb_str_intern(RNODE_LIT(symbol)->nd_lit));
1283012830
break;
1283112831
default:
1283212832
compile_error(p, "unexpected node as symbol: %s", parser_node_name(type));
@@ -12852,7 +12852,7 @@ new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
1285212852
VALUE src = RNODE_STR(node)->nd_lit;
1285312853
nd_set_type(node, NODE_LIT);
1285412854
nd_set_loc(node, loc);
12855-
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_STR(node)->nd_lit = reg_compile(p, src, options));
12855+
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit = reg_compile(p, src, options));
1285612856
}
1285712857
break;
1285812858
default:
@@ -12892,7 +12892,7 @@ new_regexp(struct parser_params *p, NODE *node, int options, const YYLTYPE *loc)
1289212892
if (!RNODE_DREGX(node)->nd_next) {
1289312893
VALUE src = RNODE_DREGX(node)->nd_lit;
1289412894
nd_set_type(node, NODE_LIT);
12895-
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_DREGX(node)->nd_lit = reg_compile(p, src, options));
12895+
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(node)->nd_lit = reg_compile(p, src, options));
1289612896
}
1289712897
if (options & RE_OPTION_ONCE) {
1289812898
node = NEW_ONCE(node, loc);
@@ -13595,7 +13595,7 @@ shareable_literal_constant(struct parser_params *p, enum shareability shareable,
1359513595
case NODE_STR:
1359613596
lit = rb_fstring(RNODE_STR(value)->nd_lit);
1359713597
nd_set_type(value, NODE_LIT);
13598-
RB_OBJ_WRITE(p->ast, &RNODE_STR(value)->nd_lit, lit);
13598+
RB_OBJ_WRITE(p->ast, &RNODE_LIT(value)->nd_lit, lit);
1359913599
return value;
1360013600

1360113601
case NODE_ZLIST:

0 commit comments

Comments
 (0)