Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index modules and classes starting with unicode characters #973

Closed
wants to merge 1 commit into from

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Sep 5, 2023

Motivation

Ruby allows using unicode characters in constant names, so we have to account for that when indexing.

Uncovered while addressing #957 (comment).

NOTE: this PR identified a bug in YARP. It's currently ignoring the original string's encoding when doing node.slice.

Implementation

Switched the regex to allow for any uppercase character, which will include unicode ones.

Automated Tests

Added a test demonstrating some unicode character classes.

@vinistock vinistock added the bugfix This PR will fix an existing bug label Sep 5, 2023
@vinistock vinistock added this to the 2023-Q3 milestone Sep 5, 2023
@vinistock vinistock self-assigned this Sep 5, 2023
@vinistock
Copy link
Member Author

Closing this for now. Let's get a sense of how common it is for people to use unicode characters in their classes, modules and constants. It's probably not common enough to be worth the added complexity and performance impact.

@vinistock vinistock closed this Oct 10, 2023
@vinistock vinistock deleted the vs/allow_indexing_unicode_constant_names branch October 10, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant