[ruby/yarp] fix: yp_interpolated_symbol_node_append
Made this function's behavior match the interpolated_string implementation. Previously, the start location was not set and left as 0. https://github.com/ruby/yarp/commit/87f348889f
This commit is contained in:
parent
06f5d8f3a0
commit
2b9a053740
@ -2816,10 +2816,11 @@ yp_interpolated_symbol_node_create(yp_parser_t *parser, const yp_token_t *openin
|
||||
|
||||
static inline void
|
||||
yp_interpolated_symbol_node_append(yp_interpolated_symbol_node_t *node, yp_node_t *part) {
|
||||
yp_node_list_append(&node->parts, part);
|
||||
if (!node->base.location.start) {
|
||||
if (node->parts.size == 0 && node->opening_loc.start == NULL) {
|
||||
node->base.location.start = part->location.start;
|
||||
}
|
||||
|
||||
yp_node_list_append(&node->parts, part);
|
||||
node->base.location.end = part->location.end;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user