aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Prokopiev <maxprokopiev@github.com>2024-01-24 20:34:29 +0100
committergit <svn-admin@ruby-lang.org>2024-01-24 20:32:01 +0000
commit6a63aaade9cf08e51920698372e8973f1580d8d7 (patch)
tree939909f8d068b48a3ddf853bf2d0177a1466baee
parent7d61454f2e4dafa19d879b48508bcedba6f28e43 (diff)
downloadruby-6a63aaade9cf08e51920698372e8973f1580d8d7.tar.gz
[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
-rw-r--r--prism/prism.c2
1 files changed, 1 insertions, 1 deletions
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: