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

[Ruby] Null-safe accessor #3813

Open
michaelblyons opened this issue Jul 31, 2023 · 0 comments
Open

[Ruby] Null-safe accessor #3813

michaelblyons opened this issue Jul 31, 2023 · 0 comments
Labels
C: Syntax T: bug A bug in an existing language feature

Comments

@michaelblyons
Copy link
Collaborator

michaelblyons commented Jul 31, 2023

What happened?

In Ruby, &. is a null-safe property accessor like ?. in some other languages.

foo[0]&.bar
#     ^^ punctuation.accessor - keyword

I think all that's needed is a negative lookahead for (?!\.) on the bitwise & and &? on the various accessor matches.

@deathaxe deathaxe added T: bug A bug in an existing language feature C: Syntax labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Syntax T: bug A bug in an existing language feature
Projects
None yet
Development

No branches or pull requests

2 participants