summaryrefslogtreecommitdiff
path: root/yarp
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-09-07 14:20:18 -0400
committergit <svn-admin@ruby-lang.org>2023-09-08 13:40:28 +0000
commitc7d61181d068b3471386749b6899dc7d3005273c (patch)
tree34705d85053bc9b46480d9f934533f7647ebf662 /yarp
parentf39b576e76b493b3fc5a9280295855fd8c9fb480 (diff)
[ruby/yarp] Flatten multitarget into multiwrite
https://github.com/ruby/yarp/commit/1021dac372
Diffstat (limited to 'yarp')
-rw-r--r--yarp/config.yml9
-rw-r--r--yarp/yarp.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/yarp/config.yml b/yarp/config.yml
index 3161006bf3..e63c2bb802 100644
--- a/yarp/config.yml
+++ b/yarp/config.yml
@@ -1766,9 +1766,12 @@ nodes:
^^^^^^^
- name: MultiWriteNode
fields:
- - name: target
- type: node
- kind: MultiTargetNode
+ - name: targets
+ type: node[]
+ - name: lparen_loc
+ type: location?
+ - name: rparen_loc
+ type: location?
- name: operator_loc
type: location
- name: value
diff --git a/yarp/yarp.c b/yarp/yarp.c
index 7c1df2343d..820361e25a 100644
--- a/yarp/yarp.c
+++ b/yarp/yarp.c
@@ -3365,11 +3365,17 @@ yp_multi_write_node_create(yp_parser_t *parser, yp_multi_target_node_t *target,
.end = value->location.end
}
},
- .target = target,
+ .targets = target->targets,
+ .lparen_loc = target->lparen_loc,
+ .rparen_loc = target->rparen_loc,
.operator_loc = YP_LOCATION_TOKEN_VALUE(operator),
.value = value
};
+ // Explicitly do not call yp_node_destroy here because we want to keep
+ // around all of the information within the MultiWriteNode node.
+ free(target);
+
return node;
}