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

Should we Further Relax Underscores in Identifiers? #1636

Closed
InsertCreativityHere opened this issue Jan 8, 2024 · 2 comments
Closed

Should we Further Relax Underscores in Identifiers? #1636

InsertCreativityHere opened this issue Jan 8, 2024 · 2 comments

Comments

@InsertCreativityHere
Copy link
Member

As of #1631, we now allow users to use underscores in their identifiers without needing a special metadata.
But I think we could go further. The parser still disallows:

  • trailing underscores: cool_
  • leading underscores: _cool
  • multiple underscores in a row: cool__stuff

I could see a case for keeping the restriction on leading underscores, since that has a special meaning in some languages.
But restricting trailing and double underscores just seems unnecessary to me. I agree they're weird, but why should the parser care? Removing these restrictions is backwards compatible, and would let us remove and simply more logic in the scanner.

@pepone
Copy link
Member

pepone commented Jan 8, 2024

I think double underscores are reserved in C++ https://en.cppreference.com/w/cpp/language/identifiers

@bernardnormier
Copy link
Member

We should keep these remaining restrictions.

@InsertCreativityHere InsertCreativityHere closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants