summaryrefslogtreecommitdiff
path: root/yarp
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-09-06 11:14:38 -0400
committergit <svn-admin@ruby-lang.org>2023-09-07 12:42:01 +0000
commit3f78eec44ab2f06f05c699cbd90714716e13ebd7 (patch)
tree96f84e340d9a35a8973223346997f8f9adc30bbb /yarp
parent9e21b33ece212b67d62cf47527a1d9e0251c9fdd (diff)
[ruby/yarp] Constants on keyword rest parameters
https://github.com/ruby/yarp/commit/5e1a8fbc54
Diffstat (limited to 'yarp')
-rw-r--r--yarp/config.yml6
-rw-r--r--yarp/yarp.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/yarp/config.yml b/yarp/config.yml
index 91d6d81cb5..b24490a333 100644
--- a/yarp/config.yml
+++ b/yarp/config.yml
@@ -1574,10 +1574,12 @@ nodes:
end
- name: KeywordRestParameterNode
fields:
- - name: operator_loc
- type: location
+ - name: name
+ type: constant?
- name: name_loc
type: location?
+ - name: operator_loc
+ type: location
comment: |
Represents a keyword rest parameter to a method, block, or lambda definition.
diff --git a/yarp/yarp.c b/yarp/yarp.c
index 6596b87620..7f9f3b5589 100644
--- a/yarp/yarp.c
+++ b/yarp/yarp.c
@@ -3088,8 +3088,9 @@ yp_keyword_rest_parameter_node_create(yp_parser_t *parser, const yp_token_t *ope
.end = (name->type == YP_TOKEN_NOT_PROVIDED ? operator->end : name->end)
},
},
- .operator_loc = YP_LOCATION_TOKEN_VALUE(operator),
- .name_loc = YP_OPTIONAL_LOCATION_TOKEN_VALUE(name)
+ .name = yp_parser_optional_constant_id_token(parser, name),
+ .name_loc = YP_OPTIONAL_LOCATION_TOKEN_VALUE(name),
+ .operator_loc = YP_LOCATION_TOKEN_VALUE(operator)
};
return node;