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

Revert "Restrict identifier grammar" #11687

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Jan 3, 2022

This change had a good motivation (#11216), but it's a breaking change for code that uses restricted code points in identifiers. Such restrictions can be reasonable for certain kinds of characters, especially non-printables, because it serves an immediate purpose of ensuring code safety (cf #11406, #11392).

But breaking backwards compatibility for perfectly working identifiers such as most emojis is inacceptable for a minor release.

💩 = 1 # Works in 1.2, but syntax error in master

Imposing further restrictions on identifier names as proposed in #11216 is still a worthy goal. But we just can't do it at this point and we might want to think a bit more about the restriction scope.
Restricting non-printables should be acceptable as a short term change.

Reverts #11508

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser topic:lang labels Jan 3, 2022
@straight-shoota straight-shoota added this to the 1.3.0 milestone Jan 3, 2022
@straight-shoota straight-shoota merged commit 06427d1 into master Jan 3, 2022
@straight-shoota straight-shoota deleted the revert-11508-feature/identifier-grammar branch January 3, 2022 20:40
@straight-shoota straight-shoota removed this from the 1.3.0 milestone Jan 3, 2022
rdp pushed a commit to rdp/crystal that referenced this pull request Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser topic:lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants