From 6a63aaade9cf08e51920698372e8973f1580d8d7 Mon Sep 17 00:00:00 2001 From: Max Prokopiev Date: Wed, 24 Jan 2024 20:34:29 +0100 Subject: [ruby/prism] Use char_is_identifier_start() to check for valid method name alnum_char() only checks for alphanumeric characters while ignoring other valid cases (like emoji codepoints for example) https://github.com/ruby/prism/commit/d15958fd28 --- prism/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prism/prism.c b/prism/prism.c index 19cd1e6d64..1c1b53f787 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -11021,7 +11021,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod return target; } - if (*call->message_loc.start == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) { + if (char_is_identifier_start(parser, call->message_loc.start)) { // When we get here, we have a method call, because it was // previously marked as a method call but now we have an =. This // looks like: -- cgit v1.2.3