summaryrefslogtreecommitdiff
path: root/yarp
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-09-10 13:47:36 -0400
committergit <svn-admin@ruby-lang.org>2023-09-13 00:55:04 +0000
commitc421f08f6b5c1cc9a52e713a81595a393ff66e8c (patch)
tree97c6022eb6330b1a7ec9e9d8f2ba644fca3cccdc /yarp
parent6e64d4370456190541705ec4c6cf3af6bf4ac647 (diff)
[ruby/yarp] Handle parsing local variable singleton method definition
https://github.com/ruby/yarp/commit/943204d56f
Diffstat (limited to 'yarp')
-rw-r--r--yarp/yarp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/yarp/yarp.c b/yarp/yarp.c
index 6379ee50c5..c7dcf482f7 100644
--- a/yarp/yarp.c
+++ b/yarp/yarp.c
@@ -11806,12 +11806,12 @@ parse_expression_prefix(yp_parser_t *parser, yp_binding_power_t binding_power) {
name = parser->previous;
break;
case YP_TOKEN_IDENTIFIER: {
- yp_parser_scope_push(parser, true);
parser_lex(parser);
if (match_any_type_p(parser, 2, YP_TOKEN_DOT, YP_TOKEN_COLON_COLON)) {
receiver = parse_variable_call(parser);
+ yp_parser_scope_push(parser, true);
lex_state_set(parser, YP_LEX_STATE_FNAME);
parser_lex(parser);
@@ -11822,6 +11822,7 @@ parse_expression_prefix(yp_parser_t *parser, yp_binding_power_t binding_power) {
yp_diagnostic_list_append(&parser->error_list, parser->previous.start, parser->previous.end, YP_ERR_DEF_NAME_AFTER_RECEIVER);
}
} else {
+ yp_parser_scope_push(parser, true);
name = parser->previous;
}